I'm using phpStorm. And I have the following piece of code written by Kohana framework:
throw HTTP_Exception::factory(404,
'The requested URL :uri was not found on this server.',
array(':uri' => $this->request->uri())
)->request($this->request);
The problem is that phpStorm considers this piece of code invalid and displays the following message: the thrown object must be an instance of the exception
. I don't like it because it shows the entire project up to first directory invalid.
Is there any way I can work around it without changing the code?
Seems like PhpStorm gets "stuck" thinking the project is a PHP7 project, even if you change the PHP version in Settings. I solved this by removing the .idea
directory altogether, and reopening the directory as a fresh project.
i meet the same error
your Exception class must extend from \Exception
;
instead of extend from Exception
;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With