File tree Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ public function toString(): string
4242 /**
4343 * @psalm-suppress ArgumentTypeCoercion
4444 */
45- public function hasVariadicParam (): bool
45+ public function isVariadic (): bool
4646 {
4747 foreach ((new ReflectionFunction ($ this ->callback ))->getParameters () as $ parameter ) {
4848 if ($ parameter ->isVariadic ()) {
@@ -63,8 +63,10 @@ public function hasVariadicParam(): bool
6363 */
6464 protected function matches (mixed $ other ): bool
6565 {
66- return $ this ->hasVariadicParam ()
67- ? ($ this ->callback )(...$ other )
68- : ($ this ->callback )($ other );
66+ if ($ this ->isVariadic ()) {
67+ return ($ this ->callback )(...$ other );
68+ }
69+
70+ return ($ this ->callback )($ other );
6971 }
7072}
Original file line number Diff line number Diff line change @@ -109,7 +109,7 @@ private function doVerify(): bool
109109 }
110110
111111 foreach ($ this ->parameters as $ i => $ parameter ) {
112- if ($ parameter instanceof Callback && $ parameter ->hasVariadicParam ()) {
112+ if ($ parameter instanceof Callback && $ parameter ->isVariadic ()) {
113113 $ other = $ this ->invocation ->parameters ();
114114 } else {
115115 $ other = $ this ->invocation ->parameters ()[$ i ];
You can’t perform that action at this time.
0 commit comments