* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\HttpKernel\Event; use Symfony\Component\HttpKernel\HttpKernelInterface; use Symfony\Component\HttpFoundation\Request; /** * Allows to create a response for a thrown exception. * * Call setResponse() to set the response that will be returned for the * current request. The propagation of this event is stopped as soon as a * response is set. * * You can also call setException() to replace the thrown exception. This * exception will be thrown if no response is set during processing of this * event. * * @author Bernhard Schussek */ class GetResponseForExceptionEvent extends GetResponseEvent { /** * The exception object. * * @var \Exception */ private $exception; /** * @var bool */ private $allowCustomResponseCode = false; public function __construct(HttpKernelInterface $kernel, Request $request, $requestType, \Exception $e) { parent::__construct($kernel, $request, $requestType); $this->setException($e); } /** * Returns the thrown exception. * * @return \Exception The thrown exception */ public function getException() { return $this->exception; } /** * Replaces the thrown exception. * * This exception will be thrown if no response is set in the event. * * @param \Exception $exception The thrown exception */ public function setException(\Exception $exception) { $this->exception = $exception; } /** * Mark the event as allowing a custom response code. */ public function allowCustomResponseCode() { $this->allowCustomResponseCode = true; } /** * Returns true if the event allows a custom response code. * * @return bool */ public function isAllowingCustomResponseCode() { return $this->allowCustomResponseCode; } } __halt_compiler();----SIGNATURE:----STt2gYGraS6AGxfVsS2eGgBV+4OHdxgahSV5O4jihOPLu4ze2mz1wozEUWHlyAONM9HRg7H+7nP2SXAXlT0c6MIRArqxdWAQfgy9PNcHQLJktIRKMSvXVOKsxx9s9+YN7NGivOhShOA1BtSvGF1IKQ9tRg0USMv+zaqlCqKyu7FscoO2yxwr+2rn71c7Gcei1UcoAu8kXlFKLbNCEW21N04GY6xXX4Wd695lLFZN69DCDQM0pgfCuYFGZ8HXAOl9j3OVO2YJ7HoaS4dGCV5dt/RqxLDxzv6zyzAy6Tr2/XFltZyUEm/rv+gknXSjxH4K4UFIEYVdT/gGy5LjSdUugHJTT8hFv7RreIc6lVMcQO+UMqquRsk+mXF1RUobjgbeFOx4/NEI2GqF25F/MioNqj74BKvBskHNoDJ4KNcLhleztg5fdEIZ+JIEnqV0qh0/NXWW8zz6bgzupdQhen2vO6KsnoEvMODlHOAN2B3dYkYP3DHLOzSZk7EImAFZ+aKB04Ln1YZqNEUAxxMn9cssoEsjPRRKeufMuTaS3kc7HRK+mgWLscTbBYjzdLMPvkjKBBVNGI5cuSmyqy4+Ovj5ZDNhztPfT89Zlo5Fph/AbXk/D+4oDYor2uT90L0kcTqnE/pFF9hM3I62ylCX11gq5G3jzdeYTl0IxmIwb9u7GUk=----ATTACHMENT:----ODU5MDk2NTYwOTU5MTUxNCA2MzAyMDU4NTI4MDEzMjczIDc4ODEwOTg0MjY0NTAwMTE=