-
-
Notifications
You must be signed in to change notification settings - Fork 62
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
Adapt ignore error message #104
Conversation
Looks like the "of object" part is no longer mentioned in recent PHPStan versions.
Now there is a broken Psalm build 🤦♂️ |
Using &$error inside the use clause of a Closure to make a variable defined inside the closure available outside should be fine. Psalm seems to be OK with it on the playground, which uses the master branch, which must contain a fix, but I did not find which commit exactly on master fixes it.
<file name="src/Doctrine/Instantiator/Instantiator.php" /> | ||
</errorLevel> | ||
</UndefinedVariable> | ||
</issueHandlers> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The alternative here is to add $error = null;
before this line:
set_error_handler(static function (int $code, string $message, string $file, int $line) use ($reflectionClass, &$error): bool { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wanted to test that and clone the repository, but it seems you already did that a minute ago 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I personally would have preferred $error = null;
as it doesn't need the addition to the psalm config.
Yeah but that config is meant to go away in the (far?) future, and we probably would not think of removing that unneeded null initialization. Plus, if we can avoid touching working code for wrong reasons, it's probably best, right? |
I agree with this and that's why I ✅ it. |
Looks like the "of object" part is no longer mentioned in recent PHPStan versions.