Skip to content

Commit

Permalink
Fixed a naming collision between the CloudHSM API and the AwsClient::…
Browse files Browse the repository at this point in the history
…getConfig methods. Operation is now called getConfigFiles, but doing getCommand('GetConfig') still works.
  • Loading branch information
jeremeamia committed Jul 2, 2015
1 parent b0b3a85 commit f2b2e36
Showing 1 changed file with 35 additions and 1 deletion.
36 changes: 35 additions & 1 deletion src/CloudHsm/CloudHsmClient.php
@@ -1,9 +1,43 @@
<?php
namespace Aws\CloudHsm;

use Aws\Api\ApiProvider;
use Aws\Api\DocModel;
use Aws\Api\Service;
use Aws\AwsClient;

/**
* This client is used to interact with **AWS CloudHSM**.
*/
class CloudHsmClient extends AwsClient {}
class CloudHsmClient extends AwsClient
{
public function __call($name, array $args)
{
// Overcomes a naming collision with `AwsClient::getConfig`.
if (lcfirst($name) === 'getConfigFiles') {
$name = 'GetConfig';
} elseif (lcfirst($name) === 'getConfigFilesAsync') {
$name = 'GetConfigAsync';
}

return parent::__call($name, $args);
}

/**
* @internal
* @codeCoverageIgnore
*/
public static function applyDocFilters(array $api, array $docs)
{
// Overcomes a naming collision with `AwsClient::getConfig`.
$api['operations']['GetConfigFiles'] = $api['operations']['GetConfig'];
$docs['operations']['GetConfigFiles'] = $docs['operations']['GetConfig'];
unset($api['operations']['GetConfig'], $docs['operations']['GetConfig']);
ksort($api['operations']);

return [
new Service($api, ApiProvider::defaultProvider()),
new DocModel($docs)
];
}
}

0 comments on commit f2b2e36

Please sign in to comment.