You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have the following (rather ugly, but required) code:
if ($this->container->has('wouterj_eloquent.initializer')) {
$this->container->get('wouterj_eloquent.initializer')->initialize();
}
This produces the following error with Psalm level 3 and this plugin (both latest version):
ERROR: PossiblyNullReference - src/WouterJEloquentBundle.php:44:68 - Cannot call method initialize on possibly null value (see https://psalm.dev/083)
$this->container->get('wouterj_eloquent.initializer')->initialize();
I would expect this plugin to somehow take the has() call into account (and thus removing null from the union return type of get()). I tried digging into the source code to contribute a fix, but I'm a bit unsure how to maintain some sort of global state that is reset after the if statement is left.
The text was updated successfully, but these errors were encountered:
I have the following (rather ugly, but required) code:
This produces the following error with Psalm level 3 and this plugin (both latest version):
I would expect this plugin to somehow take the
has()
call into account (and thus removingnull
from the union return type ofget()
). I tried digging into the source code to contribute a fix, but I'm a bit unsure how to maintain some sort of global state that is reset after the if statement is left.The text was updated successfully, but these errors were encountered: