for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* Veto.
* PHP Microframework.
*
* @author Damien Walsh <[email protected]>
* @copyright Damien Walsh 2013-2014
* @version 0.3
* @package veto
*/
namespace Veto\MVC\Controller;
use Veto\HTTP\Request;
use Veto\HTTP\Response;
use Veto\MVC\AbstractController;
* ExceptionController
* This is the default exception controller that will be called for any exceptions
* from user code that make it to the kernel.
* You can override this by specifying a different class to be used for the
* controller._exception_handler service.
* @since 0.3.0
class ExceptionController extends AbstractController
{
public function handleExceptionAction(Request $request, \Exception $exception)
$request
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.
$response = 'Sorry, something went wrong.';
if (404 === $exception->getCode()) {
$response = 'The requested resource could not be found.';
}
return new Response($response, $exception->getCode());
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.