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
count
explode
explode will return a list of strings, so i'd expect that if i call count on that list the key information should be more clear to phpstan.
https://psalm.dev/r/b608989bd7
I'd expect there to be no issue for psalm.
The text was updated successfully, but these errors were encountered:
I found these snippets:
<?php declare(strict_types = 1); function foo(string $input): void { $out = explode('-', $input); if( count($out) === 2) { consume($out); } } /** * @param array{0:string, 1: string} $input */ function consume(array $input): array{ return $input;}
Psalm output (using commit 4734583): ERROR: ArgumentTypeCoercion - 7:11 - Argument 1 of consume expects array{0: string, 1: string}, parent type non-empty-list<string> provided
Sorry, something went wrong.
53c5e52
Fix vimeo#3017 - use correct keys when converting list to array
5cf5aec
No branches or pull requests
Bug report
explode
will return a list of strings, so i'd expect that if i callcount
on that list the key information should be more clear to phpstan.Code snippet that reproduces the problem
https://psalm.dev/r/b608989bd7
Expected output
I'd expect there to be no issue for psalm.
The text was updated successfully, but these errors were encountered: