Issues (85)

src/Operation/Has.php (1 issue)

Labels
Severity
1
<?php
2
3
declare(strict_types=1);
4
5
namespace loophp\collection\Operation;
6
7
use Closure;
8
use Generator;
9
10
/**
11
 * @immutable
12
 *
13
 * @template TKey
14
 * @template T
15
 */
16
final class Has extends AbstractOperation
17
{
18
    /**
19
     * @return Closure(callable(T, TKey, iterable<TKey, T>): T ...): Closure(iterable<TKey, T>): Generator<TKey, bool>
20
     */
21 16
    public function __invoke(): Closure
22
    {
23 16
        return
24
            /**
25
             * @param callable(T, TKey, iterable<TKey, T>): T ...$callbacks
26
             *
27
             * @return Closure(iterable<TKey, T>): Generator<TKey, bool>
28
             */
29 16
            static fn (callable ...$callbacks): Closure => (new MatchOne())()(static fn (): bool => true)(
30 16
                ...array_map(
31 16
                    static fn (callable $callback): callable =>
32
                            /**
33
                             * @param T $value
34
                             * @param TKey $key
0 ignored issues
show
The type loophp\collection\Operation\TKey was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
35
                             * @param iterable<TKey, T> $iterable
36
                             */
37 16
                            static fn (mixed $value, mixed $key, iterable $iterable): bool => $callback($value, $key, $iterable) === $value,
38 16
                    $callbacks
39 16
                )
40 16
            );
41
    }
42
}
43