protected function decorateResponse($response, $method)
    {
        if (is_string($response)) {
            $response = $this->createResponse($response);
        }

        if (!($response instanceof Response)) {
            throw new \InvalidArgumentException(sprintf(
                '%s must returns a string or an object instance of %s, %s given.',
                get_class($this).'::'.$method,
                'Symfony\Component\HttpFoundation\Response',
                gettype($response)
            ));
        }

        return $response;
    }
protected function decorateResponse($response, $method)
    {
        if (is_string($response)) {
            $response = $this->createResponse($response);
        }

        if (!($response instanceof Response)) {
            throw new \InvalidArgumentException(sprintf(
                '%s must returns a string or an object instance of %s, %s given.',
                get_class($this).'::'.$method,
                'Symfony\Component\HttpFoundation\Response',
                gettype($response)
            ));
        }

        return $response;
    }
protected function decorateResponse ( $ response , $ method ) { if ( is_string ( $ response ) ) { $ response = $ this -> createResponse ( $ response ) ; } if ( ! ( $ response instanceof Response ) ) { throw new \ InvalidArgumentException ( sprintf ( '%s must returns a string or an object instance of %s, %s given.' , get_class ( $ this ) . '::' . $ method , 'Symfony\Component\HttpFoundation\Response' , gettype ( $ response ) ) ) ; } return $ response ; }
Decorate response to be sure to get Response Object

@param  String|Response  $response
@param  String           $method   method called
@return Response
@throws \InvalidArgumentException
Decorate response to be sure to get Response Object