Last active
May 11, 2018 09:32
-
-
Save adamcameron/ba1a56eb09dddfad786fb583df20c1c1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class C { | |
function f(){ | |
try { | |
$someObj->someMethod(); | |
catch (SomeException $e) { // PHPStorm now indicates that there's no reason to handle SomeException cos the try block doesn't throw it | |
// handle it | |
} | |
} | |
} | |
class SomeClass { | |
function someMethod(){ | |
if ($someCondition) { | |
return "good value"; | |
} | |
throw new SomeException("bad result"); | |
} | |
} |
In my case, PHP storm then reports there is no return on the function.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Here's the proper code, it works just fine.