ControllerDoesNotReturnResponseException example

if ($event->hasResponse()) {
                $response = $event->getResponse();
            } else {
                $msg = sprintf('The controller must return a "Symfony\Component\HttpFoundation\Response" object but it returned %s.', $this->varToString($response));

                // the user may have forgotten to return something                 if (null === $response) {
                    $msg .= ' Did you forget to add a return statement somewhere in your controller?';
                }

                throw new ControllerDoesNotReturnResponseException($msg$controller, __FILE__, __LINE__ - 17);
            }
        }

        return $this->filterResponse($response$request$type);
    }

    /** * Filters a response object. * * @throws \RuntimeException if the passed object is not a Response instance */
    
if ($event->hasResponse()) {
                $response = $event->getResponse();
            } else {
                $msg = sprintf('The controller must return a "Symfony\Component\HttpFoundation\Response" object but it returned %s.', $this->varToString($response));

                // the user may have forgotten to return something                 if (null === $response) {
                    $msg .= ' Did you forget to add a return statement somewhere in your controller?';
                }

                throw new ControllerDoesNotReturnResponseException($msg$controller, __FILE__, __LINE__ - 17);
            }
        }

        return $this->filterResponse($response$request$type);
    }

    /** * Filters a response object. * * @throws \RuntimeException if the passed object is not a Response instance */
    
Home | Imprint | This part of the site doesn't use cookies.