1 | <?php |
||
16 | class Whoops |
||
17 | { |
||
18 | /** |
||
19 | * @var Run|null To handle errors using whoops |
||
20 | */ |
||
21 | private $whoops; |
||
22 | |||
23 | /** |
||
24 | * @var bool Whether catch errors or not |
||
25 | */ |
||
26 | private $catchErrors = true; |
||
27 | |||
28 | /** |
||
29 | * Constructor.Set the whoops instance. |
||
30 | * |
||
31 | * @param Run $whoops |
||
32 | */ |
||
33 | public function __construct(Run $whoops = null) |
||
39 | |||
40 | /** |
||
41 | * Set an instance of Whoops. |
||
42 | * |
||
43 | * @param Run $whoops |
||
44 | * |
||
45 | * @return self |
||
46 | */ |
||
47 | public function whoops(Run $whoops) |
||
53 | |||
54 | /** |
||
55 | * Whether catch errors or not. |
||
56 | * |
||
57 | * @param bool $catchErrors |
||
58 | * |
||
59 | * @return self |
||
60 | */ |
||
61 | public function catchErrors($catchErrors = true) |
||
67 | |||
68 | /** |
||
69 | * Execute the middleware. |
||
70 | * |
||
71 | * @param ServerRequestInterface $request |
||
72 | * @param ResponseInterface $response |
||
73 | * @param callable $next |
||
74 | * |
||
75 | * @return ResponseInterface |
||
76 | */ |
||
77 | public function __invoke(ServerRequestInterface $request, ResponseInterface $response, callable $next) |
||
104 | |||
105 | /** |
||
106 | * Returns the whoops instance or create one. |
||
107 | * |
||
108 | * @param ServerRequestInterface $request |
||
109 | * |
||
110 | * @return Run |
||
111 | */ |
||
112 | private function getWhoopsInstance(ServerRequestInterface $request) |
||
132 | } |
||
133 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: