PhpStorm marks this method with "Missing return statement" warning.
And I am wondering if how to get rid of this, because of warnings when creating commit, etc. But without to turn off the inspection.
I know I could throw exception on end of method, and PhpStorm would be satisfied.
public static function getSomething(string $var)
{
switch ($var)
{
case 1: return something();
case 2: return somethingElse();
default: throw new NowSomethingCompletelyDifferentException();
}
}
Is there something wrong with code I am missing?
Or should I address this to JetBrains?