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
InvalidLiteralArgument
dirname()
function test(): bool { $path = dirname(__DIR__, 4); return strlen($path) > 6 && str_contains($path, 'vendor'); }
For no duplicate dirname(__DIR__, 4) I use variable $path, but psalm throw InvalidLiteralArgument. Seems, it's incorrect.
dirname(__DIR__, 4)
$path
https://psalm.dev/r/3603178ff0
The text was updated successfully, but these errors were encountered:
I found these snippets:
<?php function test(): bool { $path = dirname(__DIR__, 4); return strlen($path) > 6 && str_contains($path, 'vendor'); }
Psalm output (using commit aec0edc): ERROR: InvalidLiteralArgument - 5:46 - Argument 1 of str_contains expects a non-literal value, but '/var/www' provided
Sorry, something went wrong.
Simplified: https://psalm.dev/r/760dffc723
<?php $d = __DIR__; echo str_contains($d, "psalm");
Psalm output (using commit dd13930): ERROR: InvalidLiteralArgument - 3:19 - Argument 1 of str_contains expects a non-literal value, but '/var/www/vhosts/psalm.dev/httpdocs/src' provided
No branches or pull requests
For no duplicate
dirname(__DIR__, 4)
I use variable$path
, but psalm throwInvalidLiteralArgument
. Seems, it's incorrect.https://psalm.dev/r/3603178ff0
The text was updated successfully, but these errors were encountered: