feat: add entropy
operation
#1834
Annotations
20 errors
Static Analysis (ubuntu-latest, 8.1):
src/Collection.php#L87
Ignored error pattern #^Parameter \#1 \$callable of class loophp\\collection\\Collection constructor expects callable\(mixed \.\.\.\)\: iterable<int, float>, Closure\(iterable\)\: Generator<int, float, mixed, mixed> given\.$# in path /home/runner/work/collection/collection/src/Collection.php is expected to occur 1 time, but occurred 2 times.
|
Static Analysis (ubuntu-latest, 8.1):
src/Collection.php#L257
Parameter #1 $callable of class loophp\collection\Collection constructor expects callable(mixed ...): iterable<int, float>, Closure(iterable): Generator<int, float, mixed, mixed> given.
|
Static Analysis (ubuntu-latest, 8.1):
src/Operation/Entropy.php#L25
Anonymous function should return loophp\collection\Collection but returns loophp\collection\Contract\Collection<int, mixed>.
|
Static Analysis (ubuntu-latest, 8.1):
src/Operation/Entropy.php#L27
Parameter #1 $ of closure expects callable(mixed, mixed, iterable): mixed, Closure(mixed, int, loophp\collection\Collection): float given.
|
InvalidReturnType:
src/Operation/Entropy.php#L20
src/Operation/Entropy.php:20:16: InvalidReturnType: The declared return type 'Closure(iterable<TKey:loophp\collection\Operation\Entropy as mixed, T:loophp\collection\Operation\Entropy as mixed>):Generator<int, float, mixed, mixed>' for loophp\collection\Operation\Entropy::__invoke is incorrect, got 'Closure(iterable<mixed, mixed>):iterable<mixed, mixed>' (see https://psalm.dev/011)
|
InvalidReturnStatement:
src/Operation/Entropy.php#L24
src/Operation/Entropy.php:24:16: InvalidReturnStatement: The inferred type 'Closure(iterable<mixed, mixed>):iterable<mixed, mixed>' does not match the declared return type 'Closure(iterable<TKey:loophp\collection\Operation\Entropy as mixed, T:loophp\collection\Operation\Entropy as mixed>):Generator<int, float, mixed, mixed>' for loophp\collection\Operation\Entropy::__invoke (see https://psalm.dev/128)
|
MoreSpecificReturnType:
src/Operation/Entropy.php#L25
src/Operation/Entropy.php:25:46: MoreSpecificReturnType: The declared return type 'loophp\collection\Collection' for /home/runner/work/collection/collection/src/operation/entropy.php:25:413:-:closure is more specific than the inferred return type 'loophp\collection\Contract\Collection<int, mixed>' (see https://psalm.dev/070)
|
LessSpecificReturnStatement:
src/Operation/Entropy.php#L25
src/Operation/Entropy.php:25:60: LessSpecificReturnStatement: The type 'loophp\collection\Contract\Collection<int, mixed>' is more general than the declared return type 'loophp\collection\Collection' for /home/runner/work/collection/collection/src/operation/entropy.php:25:413:-:closure (see https://psalm.dev/129)
|
InvalidArgument:
src/Operation/Entropy.php#L27
src/Operation/Entropy.php:27:17: InvalidArgument: Argument 1 expects callable(mixed, mixed, iterable<mixed, mixed>):mixed, but impure-Closure(mixed, int, loophp\collection\Collection):(0|float) provided (see https://psalm.dev/004)
|
Static Analysis (ubuntu-latest, 8.1)
Process completed with exit code 1.
|
Static Analysis (ubuntu-latest, 8.1):
src/Collection.php#L87
Ignored error pattern #^Parameter \#1 \$callable of class loophp\\collection\\Collection constructor expects callable\(mixed \.\.\.\)\: iterable\<int, float\>, Closure\(iterable\)\: Generator\<int, float, mixed, mixed\> given\.$# in path /home/runner/work/collection/collection/src/Collection.php is expected to occur 1 time, but occurred 2 times.
|
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#L257
Parameter #1 $callable of class loophp\collection\Collection constructor expects callable(mixed ...): iterable<int, float>, Closure(iterable): Generator<int, float, mixed, mixed> given.
|
Static Analysis (ubuntu-latest, 8.1):
src/Collection.php#L308
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#L318
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#L328
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#L338
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#L464
Method loophp\collection\Collection::init() should return loophp\collection\Contract\Collection<TKey, T> but returns loophp\collection\Collection<mixed, mixed>.
|