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', 'DelegationSetId'] 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); } }