Skip to content

Chore: Fix types

Chore: Fix types #109

Triggered via pull request June 4, 2024 14:07
Status Failure
Total duration 23s
Artifacts

static-analysis.yml

on: pull_request
Matrix: Static Analysis with PHPStan
Matrix: Static Analysis with Psalm
Fit to window
Zoom out
Zoom in

Annotations

20 errors and 10 warnings
Static Analysis with PHPStan (8.1): src/ChunkIterator.php#L88
Array (array<TKey, TValue>) does not accept key int.
Static Analysis with PHPStan (8.1): src/IterableObject.php#L126
Method BenTools\IterableFunctions\IterableObject::chunk() should return iterable<int, iterable<TKey, TValue>> but returns BenTools\IterableFunctions\ChunkIterator<mixed, mixed>.
Static Analysis with PHPStan (8.1): src/IterableObject.php#L129
Method BenTools\IterableFunctions\IterableObject::chunk() should return iterable<int, iterable<TKey, TValue>> but returns array<array>.
Static Analysis with PHPStan (8.1): tests/IterableObjectTest.php#L95
Parameter #1 ...$data of method Pest\PendingCalls\TestCall::with() expects array<Closure|iterable<int|string, mixed>|string>|Closure|string, BenTools\CartesianProduct\CartesianProduct given.
Static Analysis with PHPStan (8.1): tests/IterableValuesTest.php#L27
Variable $key might not be defined.
Static Analysis with PHPStan (8.1): tests/IterableValuesTest.php#L28
Variable $value might not be defined.
Static Analysis with PHPStan (8.1): tests/IterableValuesTest.php#L45
Variable $key might not be defined.
Static Analysis with PHPStan (8.1): tests/IterableValuesTest.php#L46
Variable $value might not be defined.
Static Analysis with PHPStan (8.1): vendor/pestphp/pest/src/Expectation.php#L348
Syntax error, unexpected ')' on line 348
Static Analysis with PHPStan (8.1): vendor/pestphp/pest/src/Expectation.php#L348
Syntax error, unexpected ')', expecting ';' on line 348
InvalidPropertyAssignmentValue: src/ChunkIterator.php#L86
src/ChunkIterator.php:86:17: InvalidPropertyAssignmentValue: $this->buffer with declared type 'array<TKey:BenTools\IterableFunctions\ChunkIterator as mixed, TValue:BenTools\IterableFunctions\ChunkIterator as mixed>' cannot be assigned type 'non-empty-array<(TKey:BenTools\IterableFunctions\ChunkIterator as mixed)|int<0, max>, (TValue:BenTools\IterableFunctions\ChunkIterator as mixed)|null>' (see https://psalm.dev/145)
InvalidPropertyAssignmentValue: src/ChunkIterator.php#L88
src/ChunkIterator.php:88:17: InvalidPropertyAssignmentValue: $this->buffer with declared type 'array<TKey:BenTools\IterableFunctions\ChunkIterator as mixed, TValue:BenTools\IterableFunctions\ChunkIterator as mixed>' cannot be assigned type 'non-empty-array<(TKey:BenTools\IterableFunctions\ChunkIterator as mixed)|int<0, max>, (TValue:BenTools\IterableFunctions\ChunkIterator as mixed)|null>' (see https://psalm.dev/145)
PossiblyInvalidArgument: src/IterableObject.php#L59
src/IterableObject.php:59:95: PossiblyInvalidArgument: Argument 2 of CallbackFilterIterator::__construct expects callable(TValue:BenTools\IterableFunctions\IterableObject as mixed, TKey:BenTools\IterableFunctions\IterableObject as mixed, Iterator<mixed, mixed>):bool|callable(TValue:BenTools\IterableFunctions\IterableObject as mixed, mixed, Iterator<mixed, mixed>):bool|callable(mixed, mixed, Iterator<mixed, mixed>):bool, but possibly different type callable(TValue:BenTools\IterableFunctions\IterableObject as mixed):bool|callable(TValue:BenTools\IterableFunctions\IterableObject as mixed, TKey:BenTools\IterableFunctions\IterableObject as mixed):bool|pure-Closure(mixed):bool provided (see https://psalm.dev/092)
PossiblyInvalidArgument: src/IterableObject.php#L64
src/IterableObject.php:64:45: PossiblyInvalidArgument: Argument 2 of array_filter expects callable(TValue:BenTools\IterableFunctions\IterableObject as mixed, TKey:BenTools\IterableFunctions\IterableObject as mixed):mixed, but possibly different type callable(TValue:BenTools\IterableFunctions\IterableObject as mixed):bool|callable(TValue:BenTools\IterableFunctions\IterableObject as mixed, TKey:BenTools\IterableFunctions\IterableObject as mixed):bool provided (see https://psalm.dev/092)
UndefinedDocblockClass: tests/IterableChunkTest.php#L11
tests/IterableChunkTest.php:11:1: UndefinedDocblockClass: Docblock-defined class, interface or enum named Pest\Concerns\Expectable does not exist (see https://psalm.dev/200)
InvalidOperand: tests/IterableChunkTest.php#L18
tests/IterableChunkTest.php:18:16: InvalidOperand: Cannot use spread operator on iterable with key type mixed (see https://psalm.dev/058)
UndefinedDocblockClass: tests/IterableChunkTest.php#L31
tests/IterableChunkTest.php:31:1: UndefinedDocblockClass: Docblock-defined class, interface or enum named Pest\Concerns\Expectable does not exist (see https://psalm.dev/200)
InvalidOperand: tests/IterableChunkTest.php#L44
tests/IterableChunkTest.php:44:16: InvalidOperand: Cannot use spread operator on iterable with key type mixed (see https://psalm.dev/058)
InvalidArgument: tests/IterableMapTest.php#L23
tests/IterableMapTest.php:23:50: InvalidArgument: Type 'bar'|'foo' should be a subtype of TGeneratedFromParam0:fn-strtoupper as string (see https://psalm.dev/004)
InvalidArgument: tests/IterableMapTest.php#L29
tests/IterableMapTest.php:29:15: InvalidArgument: Type 'bar'|'foo' should be a subtype of TGeneratedFromParam0:fn-strtoupper as string (see https://psalm.dev/004)
Static Analysis with PHPStan (8.1)
Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: actions/checkout@v2, ramsey/composer-install@v1. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.
Static Analysis with PHPStan (8.1)
The following actions uses node12 which is deprecated and will be forced to run on node16: actions/checkout@v2, ramsey/composer-install@v1. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/
Static Analysis with PHPStan (8.1)
The `save-state` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Static Analysis with PHPStan (8.1)
The `save-state` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Static Analysis with PHPStan (8.1)
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Static Analysis with Psalm (8.1)
Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: actions/checkout@v2, ramsey/composer-install@v1. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.
Static Analysis with Psalm (8.1)
The following actions uses node12 which is deprecated and will be forced to run on node16: actions/checkout@v2, ramsey/composer-install@v1. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/
Static Analysis with Psalm (8.1)
The `save-state` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Static Analysis with Psalm (8.1)
The `save-state` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Static Analysis with Psalm (8.1)
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/