Skip to content

Adds tap() - allows shorter syntax for chaining no side effects operations #1934

Adds tap() - allows shorter syntax for chaining no side effects operations

Adds tap() - allows shorter syntax for chaining no side effects operations #1934

Triggered via pull request April 2, 2024 06:32
Status Failure
Total duration 1m 9s
Artifacts

static-analysis.yml

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

Annotations

13 errors and 1 warning
InvalidReturnType: src/Operation/Tap.php#L19
src/Operation/Tap.php:19:16: InvalidReturnType: The declared return type 'Closure(callable(T:loophp\collection\Operation\Tap as mixed, TKey:loophp\collection\Operation\Tap as mixed, iterable<TKey:loophp\collection\Operation\Tap as mixed, T:loophp\collection\Operation\Tap as mixed>):void...):Closure(iterable<TKey:loophp\collection\Operation\Tap as mixed, T:loophp\collection\Operation\Tap as mixed>):Generator<TKey:loophp\collection\Operation\Tap as mixed, T:loophp\collection\Operation\Tap as mixed, mixed, mixed>' for loophp\collection\Operation\Tap::__invoke is incorrect, got 'impure-Closure(callable(T:loophp\collection\Operation\Tap as mixed, TKey:loophp\collection\Operation\Tap as mixed, iterable<TKey:loophp\collection\Operation\Tap as mixed, T:loophp\collection\Operation\Tap as mixed>):bool...):Closure(iterable<TKey:loophp\collection\Operation\Tap as mixed, T:loophp\collection\Operation\Tap as mixed>):Generator<TKey:loophp\collection\Operation\Tap as mixed, T:loophp\collection\Operation\Tap as mixed, mixed, mixed>' (see https://psalm.dev/011)
InvalidReturnStatement: src/Operation/Tap.php#L29
src/Operation/Tap.php:29:13: InvalidReturnStatement: The inferred type 'impure-Closure(callable(T:loophp\collection\Operation\Tap as mixed, TKey:loophp\collection\Operation\Tap as mixed, iterable<TKey:loophp\collection\Operation\Tap as mixed, T:loophp\collection\Operation\Tap as mixed>):bool...):Closure(iterable<TKey:loophp\collection\Operation\Tap as mixed, T:loophp\collection\Operation\Tap as mixed>):Generator<TKey:loophp\collection\Operation\Tap as mixed, T:loophp\collection\Operation\Tap as mixed, mixed, mixed>' does not match the declared return type 'Closure(callable(T:loophp\collection\Operation\Tap as mixed, TKey:loophp\collection\Operation\Tap as mixed, iterable<TKey:loophp\collection\Operation\Tap as mixed, T:loophp\collection\Operation\Tap as mixed>):void...):Closure(iterable<TKey:loophp\collection\Operation\Tap as mixed, T:loophp\collection\Operation\Tap as mixed>):Generator<TKey:loophp\collection\Operation\Tap as mixed, T:loophp\collection\Operation\Tap as mixed, mixed, mixed>' for loophp\collection\Operation\Tap::__invoke (see https://psalm.dev/128)
Static Analysis (ubuntu-latest, 8.1)
Process completed with exit code 1.
Static Analysis (ubuntu-latest, 8.1): src/Collection.php#L102
Method loophp\collection\Collection::coalesce() should return loophp\collection\Contract\Collection<TKey, T> but returns loophp\collection\Collection<mixed, mixed>.
Static Analysis (ubuntu-latest, 8.1): src/Collection.php#L107
Method loophp\collection\Collection::collapse() should return loophp\collection\Contract\Collection<TKey, T> but returns loophp\collection\Collection<mixed, mixed>.
Static Analysis (ubuntu-latest, 8.1): src/Collection.php#L164
Method loophp\collection\Collection::cycle() should return loophp\collection\Contract\Collection<TKey, T> but returns loophp\collection\Collection<mixed, mixed>.
Static Analysis (ubuntu-latest, 8.1): src/Collection.php#L311
Method loophp\collection\Collection::flip() should return loophp\collection\Contract\Collection<T, TKey> but returns loophp\collection\Collection<mixed, mixed>.
Static Analysis (ubuntu-latest, 8.1): src/Collection.php#L321
Parameter #1 $ of closure expects callable(mixed, mixed, mixed, iterable): mixed, callable(T|V, T, TKey, iterable<TKey, T>): V given.
Static Analysis (ubuntu-latest, 8.1): src/Collection.php#L331
Parameter #1 $ of closure expects callable(mixed, mixed, mixed, iterable): mixed, callable(T|V, T, TKey, iterable<TKey, T>): V given.
Static Analysis (ubuntu-latest, 8.1): src/Collection.php#L341
Method loophp\collection\Collection::frequency() should return loophp\collection\Contract\Collection<int, T> but returns loophp\collection\Collection<int, mixed>.
Static Analysis (ubuntu-latest, 8.1): src/Collection.php#L467
Method loophp\collection\Collection::init() should return loophp\collection\Contract\Collection<TKey, T> but returns loophp\collection\Collection<mixed, mixed>.
Static Analysis (ubuntu-latest, 8.1): src/Collection.php#L515
Method loophp\collection\Collection::keys() should return loophp\collection\Contract\Collection<int, TKey> but returns loophp\collection\Collection<int, mixed>.
Static Analysis (ubuntu-latest, 8.1): src/Collection.php#L570
Method loophp\collection\Collection::normalize() should return loophp\collection\Contract\Collection<int, T> but returns loophp\collection\Collection<int, mixed>.
Static Analysis (ubuntu-latest, 8.1)
Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: actions/cache@v3. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.