parser = $parser ?: new JsonParser(); } public function __invoke( CommandInterface $command, ResponseInterface $response ) { $operation = $this->api->getOperation($command->getName()); $result = null === $operation['output'] ? null : $this->parser->parse( $operation->getOutput(), $this->parseJson($response->getBody()) ); return new Result($result ?: []); } }