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
code :
<?php declare(strict_types=1); namespace Psl\Arr; /** * @psalm-template Tk of array-key * @psalm-template Tv * * @psalm-param array<Tk, Tv> $iterable * @psalm-param (callable(Tk, Tk): int) $comparator * * @psalm-return array<Tk, Tv> */ function sort_by_key(array $iterable, callable $comparator): array { $result = $iterable; \uksort($result, $comparator); return $result; }
error :
Psalm output (using commit 306ed07): ERROR: InvalidScalarArgument - 19:22 - Argument 2 of uksort expects callable(array-key, array-key):int, callable(Tk:fn-psl\arr\sort_by_key as array-key, Tk:fn-psl\arr\sort_by_key as array-key):int provided
snippet : https://psalm.dev/r/db79f4c93f
removing the namespace resolves the issue ( by definitely not a solution ) : https://psalm.dev/r/ee95831404
The text was updated successfully, but these errors were encountered:
I found these snippets:
<?php declare(strict_types=1); /** * @psalm-template Tk of array-key * @psalm-template Tv * * @psalm-param array<Tk, Tv> $iterable * @psalm-param (callable(Tk, Tk): int) $comparator * * @psalm-return array<Tk, Tv> */ function sort_by_key(array $iterable, callable $comparator): array { $result = $iterable; \uksort($result, $comparator); return $result; }
Psalm output (using commit 306ed07): No issues!
Sorry, something went wrong.
f4485cc
Sorry, this was a dumb bug
🎉 Thanks for the quick fix ❤️
No branches or pull requests
code :
error :
snippet : https://psalm.dev/r/db79f4c93f
removing the namespace resolves the issue ( by definitely not a solution ) : https://psalm.dev/r/ee95831404
The text was updated successfully, but these errors were encountered: