vscode-intelephense icon indicating copy to clipboard operation
vscode-intelephense copied to clipboard

Declared but not used false positive

Open duzenko opened this issue 2 years ago • 3 comments

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 image

Platform and version Ubuntu, latest

duzenko avatar Aug 08 '22 10:08 duzenko

What value do you have set for intelephense.environment.phpVersion ?

bmewburn avatar Aug 16 '22 22:08 bmewburn

It was 8.1.0

duzenko avatar Aug 17 '22 09:08 duzenko

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?

duzenko avatar Sep 08 '22 08:09 duzenko