1 | <?php |
||
29 | class Reporter implements \Minotaur\Route\Plugin |
||
30 | { |
||
31 | /** |
||
32 | * @var \Minotaur\ErrorLogger |
||
33 | */ |
||
34 | private $errorLogger; |
||
35 | |||
36 | /** |
||
37 | * Creates a new error Reporter. |
||
38 | * |
||
39 | * @param $errorLogger - The error logger |
||
40 | */ |
||
41 | 1 | public function __construct(\Minotaur\ErrorLogger $errorLogger) |
|
45 | |||
46 | /** |
||
47 | * Gets the plugin priority; larger means first. |
||
48 | * |
||
49 | * @return - The plugin priority |
||
|
|||
50 | */ |
||
51 | public function getPriority(): int |
||
55 | |||
56 | /** |
||
57 | * Middleware request–response handling. |
||
58 | * |
||
59 | * Performs a typical passthru (i.e. `return $next($req, $res);`), but in |
||
60 | * the event an `Exception` occurs, the `$errorLogger` is called, then the |
||
61 | * `Exception` is rethrown (most likely to be caught higher in the queue). |
||
62 | * |
||
63 | * @param $request - The server request |
||
64 | * @param $response - The response |
||
65 | * @param callable $next The next layer. (function (Request,Response): Response) |
||
66 | * @return - The response |
||
67 | * @throws \Exception rethrows any exception that occurs after logging. |
||
68 | */ |
||
69 | 1 | public function __invoke(Request $request, Response $response, callable $next): Response |
|
78 | } |
||
79 |
This check marks PHPDoc comments that could not be parsed by our parser. To see which comment annotations we can parse, please refer to our documentation on supported doc-types.