1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70
<?php
/**
* Slim Framework (https://slimframework.com)
*
* @link https://github.com/slimphp/Slim
* @copyright Copyright (c) 2011-2017 Josh Lockhart
* @license https://github.com/slimphp/Slim/blob/3.x/LICENSE.md (MIT License)
*/
namespace Slim\Exception;
use Exception;
use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Message\ResponseInterface;
/**
* Stop Exception
*
* This Exception is thrown when the Slim application needs to abort
* processing and return control flow to the outer PHP script.
*/
class SlimException extends Exception
{
/**
* A request object
*
* @var ServerRequestInterface
*/
protected $request;
/**
* A response object to send to the HTTP client
*
* @var ResponseInterface
*/
protected $response;
/**
* Create new exception
*
* @param ServerRequestInterface $request
* @param ResponseInterface $response
*/
public function __construct(ServerRequestInterface $request, ResponseInterface $response)
{
parent::__construct();
$this->request = $request;
$this->response = $response;
}
/**
* Get request
*
* @return ServerRequestInterface
*/
public function getRequest()
{
return $this->request;
}
/**
* Get response
*
* @return ResponseInterface
*/
public function getResponse()
{
return $this->response;
}
}