xmlParser = $xmlParser ?: new XmlParser(); $this->honorResultWrapper = $honorResultWrapper; } public function __invoke( CommandInterface $command, ResponseInterface $response ) { $output = $this->api->getOperation($command->getName())->getOutput(); $xml = $this->parseXml($response->getBody()); if ($this->honorResultWrapper && $output['resultWrapper']) { $xml = $xml->{$output['resultWrapper']}; } return new Result($this->xmlParser->parse($output, $xml)); } }