chore: more specific return type for chunk() method #1956
Annotations
19 errors and 1 warning
Run Grumphp:
tests/static-analysis/chunk.php#L19
Parameter #1 $collection of function chunk_checkList expects loophp\collection\Contract\Collection<int, array<int, int>>, loophp\collection\Contract\Collection<int, non-empty-array<int, int>> given.
|
Run Grumphp:
tests/static-analysis/chunk.php#L20
Parameter #1 $collection of function chunk_checkList expects loophp\collection\Contract\Collection<int, array<int, int>>, loophp\collection\Contract\Collection<int, non-empty-array<int, int>> given.
|
Run Grumphp:
tests/static-analysis/chunk.php#L24
Parameter #1 $collection of function chunk_checkMap expects loophp\collection\Contract\Collection<int, array<int, string>>, loophp\collection\Contract\Collection<int, non-empty-array<int, string>> given.
|
Run Grumphp:
tests/static-analysis/chunk.php#L26
Parameter #1 $collection of function chunk_checkMap expects loophp\collection\Contract\Collection<int, array<int, string>>, loophp\collection\Contract\Collection<int, non-empty-array<int, string>> given.
|
Run Grumphp:
src/Collection.php#L97
src/Collection.php:97:16: InvalidReturnStatement: The inferred type 'loophp\collection\Collection<int, list<mixed>>' does not match the declared return type 'loophp\collection\Contract\Collection<int, non-empty-list<T:loophp\collection\Collection as mixed>>' for loophp\collection\Collection::chunk (see https://psalm.dev/128)
|
Run Grumphp:
src/Collection.php#L881
src/Collection.php:881:29: InvalidReturnType: The declared return type 'loophp\collection\Contract\Collection<int, array<TKey:loophp\collection\Collection as mixed, T:loophp\collection\Collection as mixed>>' for loophp\collection\Collection::wrap is incorrect, got 'loophp\collection\Collection<int, array<array-key, mixed>>' (see https://psalm.dev/011)
|
Run Grumphp:
tests/static-analysis/chunk.php#L19
tests/static-analysis/chunk.php:19:17: InvalidArgument: Argument 1 of chunk_checkList expects loophp\collection\Contract\Collection<int, list<int>>, but loophp\collection\Contract\Collection<int, non-empty-list<int>> provided (see https://psalm.dev/004)
|
Run Grumphp:
tests/static-analysis/chunk.php#L20
tests/static-analysis/chunk.php:20:17: InvalidArgument: Argument 1 of chunk_checkList expects loophp\collection\Contract\Collection<int, list<int>>, but loophp\collection\Contract\Collection<int, non-empty-list<int>> provided (see https://psalm.dev/004)
|
Run Grumphp
Process completed with exit code 1.
|
Send feedback on Github:
src/Collection.php#L102
Method loophp\collection\Collection::coalesce() should return loophp\collection\Contract\Collection<TKey, T> but returns loophp\collection\Collection<mixed, mixed>.
|
Send feedback on Github:
src/Collection.php#L107
Method loophp\collection\Collection::collapse() should return loophp\collection\Contract\Collection<TKey, T> but returns loophp\collection\Collection<mixed, mixed>.
|
Send feedback on Github:
src/Collection.php#L164
Method loophp\collection\Collection::cycle() should return loophp\collection\Contract\Collection<TKey, T> but returns loophp\collection\Collection<mixed, mixed>.
|
Send feedback on Github:
src/Collection.php#L311
Method loophp\collection\Collection::flip() should return loophp\collection\Contract\Collection<T, TKey> but returns loophp\collection\Collection<mixed, mixed>.
|
Send feedback on Github:
src/Collection.php#L341
Method loophp\collection\Collection::frequency() should return loophp\collection\Contract\Collection<int, T> but returns loophp\collection\Collection<int, mixed>.
|
Send feedback on Github:
src/Collection.php#L467
Method loophp\collection\Collection::init() should return loophp\collection\Contract\Collection<TKey, T> but returns loophp\collection\Collection<mixed, mixed>.
|
Send feedback on Github:
src/Collection.php#L515
Method loophp\collection\Collection::keys() should return loophp\collection\Contract\Collection<int, TKey> but returns loophp\collection\Collection<int, mixed>.
|
Send feedback on Github:
src/Collection.php#L570
Method loophp\collection\Collection::normalize() should return loophp\collection\Contract\Collection<int, T> but returns loophp\collection\Collection<int, mixed>.
|
Send feedback on Github:
src/Collection.php#L595
Method loophp\collection\Collection::pair() should return loophp\collection\Contract\Collection<T, T|null> but returns loophp\collection\Collection<mixed, mixed>.
|
Send feedback on Github:
src/Collection.php#L666
Method loophp\collection\Collection::reverse() should return loophp\collection\Contract\Collection<TKey, T> but returns loophp\collection\Collection<mixed, mixed>.
|
The following actions use a deprecated Node.js version and will be forced to run on node20: actions/cache@v3. For more info: https://github.blog/changelog/2024-03-07-github-actions-all-actions-will-run-on-node20-instead-of-node16-by-default/
|
Loading