Answer the question
In order to leave comments, you need to log in
Hint bug in IDE?
/**
* @throws UserNotFoundException
*/
private function obtain()
{
try {
// do stuff
}
catch (UserNotFoundException | Exception $throwable) {
//do stuff
}
}
Answer the question
In order to leave comments, you need to log in
This is not a bug, phpstorm requires the "@throws" tag to be written in the place where the exception is thrown, not handled, generally logical.
function editFile($fileName,$path){
try{
......your code...
openFile($fileName, $path);
}catch(Exception $exception){
...catch body....
}
function openFile($file,$path){
....some code....
throw new Exception( 'error');
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question