Skip to content

Commit 8bb0e8b

Browse files
kubawerlossebastianbergmann
authored andcommitted
Simplify check for variadic callback
1 parent ea55a6f commit 8bb0e8b

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

src/Framework/Constraint/Callback.php

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,7 @@ public function toString(): string
4242

4343
public function isVariadic(): bool
4444
{
45-
foreach ((new ReflectionFunction(Closure::fromCallable($this->callback)))->getParameters() as $parameter) {
46-
if ($parameter->isVariadic()) {
47-
return true;
48-
}
49-
}
50-
51-
return false;
45+
return (new ReflectionFunction(Closure::fromCallable($this->callback)))->isVariadic();
5246
}
5347

5448
/**

0 commit comments

Comments
 (0)