We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Runnable example: https://psalm.dev/r/de34c21744
Code from the example:
<?php interface SomeInterface { public function doSomething(): void; } final class FirstImplementation implements SomeInterface { /** @var int */ public $someField = 42; public function doSomething(): void {} } function magic(SomeInterface $x): void { if (!property_exists(get_class($x), 'someField')) { return; } if (!isset($x->someField)) { return; } $x->someField = 0; }; $x = new FirstImplementation(); magic($x); assert($x->someField === 0);
It should be possible to access the property after checking that it exists.
Using both property_exists and isset to prove they both don't work.
property_exists
isset
The text was updated successfully, but these errors were encountered:
add pslam with level 4, fix pslam errors, add baseline because of a p…
fb1990d
…roperty check on interface see vimeo/psalm#2206
ea3badf
add pslam with level 4, fix psalm errors, add baseline because of a p…
b986b3c
has-property-
No branches or pull requests
Runnable example: https://psalm.dev/r/de34c21744
Code from the example:
It should be possible to access the property after checking that it exists.
Using both
property_exists
andisset
to prove they both don't work.The text was updated successfully, but these errors were encountered: