src/Guzzle/Service/Command/OperationResponseParser.php
protected function parseClass(CommandInterface $command)
    {
        // Emit the operation.parse_class event. If a listener injects a 'result' property, then that will be the result
        $event = new CreateResponseClassEvent(array('command' => $command));
        $command->getClient()->getEventDispatcher()->dispatch('command.parse_response', $event);
        if ($result = $event->getResult()) {
            return $result;
        }

        $className = $command->getOperation()->getResponseClass();
        if (!method_exists($className, 'fromCommand')) {
            throw new ResponseClassException("{$className} must exist and implement a static fromCommand() method");
        }

        return $className::fromCommand($command);
    }
protected function parseClass(CommandInterface $command)
    {
        // Emit the operation.parse_class event. If a listener injects a 'result' property, then that will be the result
        $event = new CreateResponseClassEvent(array('command' => $command));
        $command->getClient()->getEventDispatcher()->dispatch('command.parse_response', $event);
        if ($result = $event->getResult()) {
            return $result;
        }

        $className = $command->getOperation()->getResponseClass();
        if (!method_exists($className, 'fromCommand')) {
            throw new ResponseClassException("{$className} must exist and implement a static fromCommand() method");
        }

        return $className::fromCommand($command);
    }
protected function parseClass ( CommandInterface $ command ) { // Emit the operation.parse_class event. If a listener injects a 'result' property, then that will be the result $ event = new CreateResponseClassEvent ( array ( 'command' => $ command ) ) ; $ command -> getClient ( ) -> getEventDispatcher ( ) -> dispatch ( 'command.parse_response' , $ event ) ; if ( $ result = $ event -> getResult ( ) ) { return $ result ; } $ className = $ command -> getOperation ( ) -> getResponseClass ( ) ; if ( ! method_exists ( $ className , 'fromCommand' ) ) { throw new ResponseClassException ( "{$className} must exist and implement a static fromCommand() method" ) ; } return $ className :: fromCommand ( $ command ) ; }
Parse a class object

@param CommandInterface $command Command to parse into an object

@return mixed
@throws ResponseClassException
Parse a class object