for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace loophp\collection\Enum;
use Closure;
use function array_slice;
enum Combinators
{
public static function extractArgs(Closure $f, int $offset = 0, int $length = 0): Closure
return static fn (...$args): mixed => $f(...array_slice($args, $offset, $length));
}
public static function I(): Closure
return static fn (...$a): mixed => current($a);
public static function K(): Closure
return static fn (...$a): Closure => static fn (...$b): mixed => current($a);
$b
If this is a false-positive, you can also ignore this issue in your code via the ignore-unused annotation
ignore-unused
return static fn (...$a): Closure => static fn (/** @scrutinizer ignore-unused */ ...$b): mixed => current($a);
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
public static function Ki(): Closure
return static fn (...$a): Closure => static fn (...$b): mixed => current($b);
$a
return static fn (/** @scrutinizer ignore-unused */ ...$a): Closure => static fn (...$b): mixed => current($b);
public static function reverseArgs(Closure $f): Closure
return static fn (...$args): mixed => $f(...array_reverse($args));
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.