-
Notifications
You must be signed in to change notification settings - Fork 663
New issue
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
UndefinedPropertyFetch should not be emitted when within a property_exists check #5913
Labels
Comments
I found these snippets: https://psalm.dev/r/7b8648a68c<?php
class Foo
{
public function __construct(array $data)
{
foreach ($data as $key => $value) {
$this->{$key} = $value;
}
}
}
$foo = new Foo(['bar' => 'hello']);
if (property_exists($foo, 'bar')) {
echo $foo->bar;
}
|
Same here, but the weird thing is that methods into |
I found these snippets: https://psalm.dev/r/2d09a2b002<?php
class A
{
public function test(array $array): mixed
{
if (property_exists($this, 'xProperties')) {
return $this->xProperties;
}
if (method_exists($this, 'testing')) {
return $this->testing($array);
}
return null;
}
}
|
duplicate of #2206 |
ghost
mentioned this issue
May 3, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://psalm.dev/r/7b8648a68c
I assume very related to #4182
The text was updated successfully, but these errors were encountered: