| 1 |
<?php |
| 2 |
/** |
| 3 |
* @package WPEmerge |
| 4 |
* @author Atanas Angelov <hi@atanas.dev> |
| 5 |
* @copyright 2017-2019 Atanas Angelov |
| 6 |
* @license https://www.gnu.org/licenses/gpl-2.0.html GPL-2.0 |
| 7 |
* @link https://wpemerge.com/ |
| 8 |
*/ |
| 9 |
|
| 10 |
namespace WPEmerge\Exceptions; |
| 11 |
|
| 12 |
use Exception as PhpException; |
| 13 |
use Psr\Http\Message\ResponseInterface; |
| 14 |
use WPEmerge\Requests\RequestInterface; |
| 15 |
|
| 16 |
interface ErrorHandlerInterface { |
| 17 |
/** |
| 18 |
* Register any necessary error, exception and shutdown handlers. |
| 19 |
* |
| 20 |
* @return void |
| 21 |
*/ |
| 22 |
public function register(); |
| 23 |
|
| 24 |
/** |
| 25 |
* Unregister any registered error, exception and shutdown handlers. |
| 26 |
* |
| 27 |
* @return void |
| 28 |
*/ |
| 29 |
public function unregister(); |
| 30 |
|
| 31 |
/** |
| 32 |
* Get a response representing the specified exception. |
| 33 |
* |
| 34 |
* @param RequestInterface $request |
| 35 |
* @param PhpException $exception |
| 36 |
* @return ResponseInterface |
| 37 |
*/ |
| 38 |
public function getResponse( RequestInterface $request, PhpException $exception ); |
| 39 |
} |
| 40 |
|