/**
  * Handle the parsing.
  *
  * @param CommandInterface $command     Command.
  * @param Response         $response    Response.
  * @param string           $contentType Content type.
  *
  * @return mixed Returns the result to set on the command.
  */
 protected function handleParsing(CommandInterface $command, Response $response, $contentType)
 {
     $deserialized = $this->deserialize($command, $response, $contentType);
     if (null !== $deserialized) {
         return $deserialized;
     } else {
         return $this->fallback->parse($command);
     }
 }
示例#2
0
 /**
  * Gets the response parser to set on commands
  *
  * @return \Guzzle\Service\Command\ResponseParserInterface
  */
 public function getResponseParser()
 {
     // @codeCoverageIgnoreStart
     if (!$this->parser) {
         $this->parser = ResponseParser::getInstance();
         $this->parser->addVisitor('links', new LinksVisitor());
         $this->parser->addVisitor('embedded', new EmbeddedVisitor());
     }
     // @codeCoverageIgnoreEnd
     return $this->parser;
 }