Conversation
Fixes: 127 Method HTMLPurifier_VarParser::parse() should return string but return statement is missing
|
Is there a way to suppress the warning with a noreturn annotation on the method call that would be preferred |
|
If there is no return statement, the function returns "void", correct? If you store the return value to a variable, it's stored as "null". "void" as a return type is possible since PHP 7.1.0. So you would prefer something like |
|
Not necessarily! If you raise an exception you don't need to return |
|
Oh, you are right! I was also thinking about changing the PHPDoc of function |
|
If I set If I set it to How do we proceed? |
|
If there is no way to indicate to PHPStorm that errorGeneric always throws an exception, refactor the code so that the helper function returns the exception object, and throw it at the call site. |

Fixes:
127 Method HTMLPurifier_VarParser::parse() should return string but return statement is missing