Closed umer936 closed 3 months ago
Is that fatal saying twice the same exact line? Weird
But either way, this is actually the correct the way it was so far.
The code does not contain the beforeFilter()
https://github.com/cakephp/app/blob/5.x/src/Controller/AppController.php
And the error controller defines it without actual type as @return \Cake\Http\Response|null|void
You added that type yourself, and as per documentation it can return (and in some cases must) Response, e.g. for redirects.
So the typehint \Cake\Http\Response|null|void
documented is correct.
It would be the actual type \Cake\Http\Response|null
if you always return something, that's a choice you can make on your project level.
The changes proposed as such can not be adapted/merged here.
Closing for reasons stated above.
Fixes: