diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index b6c9f81..34a5bfd 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -384,12 +384,6 @@ parameters: count: 1 path: src/Utils/FunctionPipeline.php - - - message: '#^PHPDoc tag @param for parameter \$functions with type array\ is not subtype of native type callable\.$#' - identifier: parameter.phpDocType - count: 1 - path: src/Utils/FunctionPipeline.php - - message: '#^Unsafe usage of new static\(\)\.$#' identifier: new.static @@ -474,12 +468,6 @@ parameters: count: 1 path: src/Utils/PartiallyAppliedFunction.php - - - message: '#^Parameter \#1 \$array \(list\) of array_values is already a list, call has no effect\.$#' - identifier: arrayValues.list - count: 1 - path: src/Utils/PartiallyAppliedFunction.php - - message: '#^Property Kadet\\Functional\\Utils\\PartiallyAppliedFunction\:\:\$arguments has no type specified\.$#' identifier: missingType.property @@ -701,9 +689,3 @@ parameters: identifier: missingType.parameter count: 1 path: src/functions.php - - - - message: '#^Interface Kadet\\Functional\\Predicate referenced with incorrect case\: Kadet\\Functional\\predicate\.$#' - identifier: interface.nameCase - count: 2 - path: src/functions.php diff --git a/src/Utils/FunctionPipeline.php b/src/Utils/FunctionPipeline.php index 0bc6c3e..216535f 100644 --- a/src/Utils/FunctionPipeline.php +++ b/src/Utils/FunctionPipeline.php @@ -20,7 +20,7 @@ class FunctionPipeline /** * FunctionPipeline constructor. * - * @param callable[] $functions + * @param callable ...$functions */ public function __construct(callable ...$functions) { diff --git a/src/Utils/PartiallyAppliedFunction.php b/src/Utils/PartiallyAppliedFunction.php index 6bf81cc..a521e92 100644 --- a/src/Utils/PartiallyAppliedFunction.php +++ b/src/Utils/PartiallyAppliedFunction.php @@ -55,10 +55,7 @@ class PartiallyAppliedFunction implements Decorator, Compilable : $argument; } - return array_merge( - array_values($result), - array_values($args) - ); + return array_merge($result, array_values($args)); } public function getDecorated() diff --git a/src/functions.php b/src/functions.php index 6deb6ee..4dc7298 100644 --- a/src/functions.php +++ b/src/functions.php @@ -102,13 +102,13 @@ function unpack($arguments) function all(...$predicates) { $predicates = unpack($predicates); - return new AllOfPredicate(...array_map(predicate::class, $predicates)); + return new AllOfPredicate(...array_map(predicate(...), $predicates)); } function any(...$predicates) { $predicates = unpack($predicates); - return new AnyOfPredicate(...array_map(predicate::class, $predicates)); + return new AnyOfPredicate(...array_map(predicate(...), $predicates)); } function symbol($name = null)