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
DateTimeImmutable::modify()
false
See https://psalm.dev/r/2105756a05
According to a related PR in PHPStan phpstan/phpstan-src#1267, in PHP 8 instead of returning false, an exception is thrown.
The text was updated successfully, but these errors were encountered:
I found these snippets:
<?php $datetime = new DateTimeImmutable(); // This raises a PossiblyFalseArgument error - apparently due to the function call inside `->modify()`: $foo = $datetime->modify('+' . getInteger() . ' day'); new Foo($foo); // This doesn't: $foo2 = $datetime->modify('+1 day'); new Foo($foo2); function getInteger(): int { return 1; } class Foo { public function __construct(DateTimeImmutable $datetime) { } }
Psalm output (using commit 16b24bd): ERROR: PossiblyFalseArgument - 6:9 - Argument 1 of Foo::__construct cannot be false, possibly DateTimeImmutable value expected
Sorry, something went wrong.
No branches or pull requests
See https://psalm.dev/r/2105756a05
According to a related PR in PHPStan phpstan/phpstan-src#1267, in PHP 8 instead of returning
false
, an exception is thrown.The text was updated successfully, but these errors were encountered: