Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed a naming collision between the CloudHSM API and the AwsClient::…
…getConfig methods. Operation is now called getConfigFiles, but doing getCommand('GetConfig') still works.
- Loading branch information
1 parent
b0b3a85
commit f2b2e36
Showing
1 changed file
with
35 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) | ||
]; | ||
} | ||
} |