vscode-intelephense
vscode-intelephense copied to clipboard
Declared but not used false positive
Describe the bug Declared but not used false positive
To Reproduce
try {
UserActivationService::getActivationCode( $this->testEmailAddress );
throw new Exception( 'modifyActivation() left old email in DB' );
} catch ( \Exception_Storage_NoOrManySets $e ) {
// as expected
}
Expected behavior On PHP 7 it's not allowed to omit exception variable in the catch block AFAIK
Screenshots
Platform and version Ubuntu, latest
What value do you have set for intelephense.environment.phpVersion
?
It was 8.1.0
Sorry for reopening this again, but do you think there is room for improvement here? I mean, e.g. PHPStorm picks up PHP version automatically from composer.json, as if it's a per-project setting Maybe intelephense should support this path as well?