Файл: includes/library/aws/Aws/Route53/Route53Client.php
Строк: 56
<?php
namespace AwsRoute53;
use AwsAwsClient;
use AwsCommandInterface;
use PsrHttpMessageRequestInterface;
/**
* This client is used to interact with the **Amazon Route 53** service.
*/
class Route53Client extends AwsClient
{
public function __construct(array $args)
{
parent::__construct($args);
$this->getHandlerList()->appendInit($this->cleanIdFn(), 'route53.clean_id');
}
private function cleanIdFn()
{
return function (callable $handler) {
return function (CommandInterface $c, RequestInterface $r = null) use ($handler) {
foreach (['Id', 'HostedZoneId'] as $clean) {
if ($c->hasParam($clean)) {
$c[$clean] = $this->cleanId($c[$clean]);
}
}
return $handler($c, $r);
};
};
}
private function cleanId($id)
{
static $toClean = ['/hostedzone/', '/change/', '/delegationset/'];
return str_replace($toClean, '', $id);
}
}