-
Notifications
You must be signed in to change notification settings - Fork 666
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
in_array and TypeDoesNotContainNull #6333
Comments
I found these snippets: https://psalm.dev/r/274c08c832<?php
function a(): ?string{
return null;
}
$id = 'abc';
$srcProductId = a();
$srcCardId = a();
if (in_array($id, [$srcProductId, $srcCardId], true)) {
echo "ok";
}
|
https://psalm.dev/r/f60f99e23a is possibly related (RedundantCondition for exactly null) |
I found these snippets: https://psalm.dev/r/f60f99e23a<?php
function test(?string $x, string $y): void {
if (in_array($x, [null, $y], true)) {
if ($x === null) {
echo "Saw null\n";
}
echo "Saw $x\n";
}
}
|
TysonAndre
added a commit
to TysonAndre/psalm
that referenced
this issue
Sep 4, 2021
Modified approach to vimeo#6396 Fixes vimeo#6333
TysonAndre
added a commit
to TysonAndre/psalm
that referenced
this issue
Sep 4, 2021
Modified approach to vimeo#6396 by orklah Fixes vimeo#6333 Co-Authored-By: orklah <[email protected]>
TysonAndre
added a commit
to TysonAndre/psalm
that referenced
this issue
Sep 4, 2021
Modified approach to vimeo#6396 by orklah Fixes vimeo#6333 Co-Authored-By: orklah <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Here is example:
https://psalm.dev/r/274c08c832
The text was updated successfully, but these errors were encountered: