Skip to content

Commit ca1fe68

Browse files
joranvarlstrojny
authored andcommitted
Adjust some type annotations for variadic functions (lstrojny#182)
According to phpDocumentor (https://github.com/phpDocumentor/ReflectionDocBlock/blob/14f9edf1ae14d6ce417afb05a9ed37d7b3cc341e/tests/unit/DocBlock/Tags/ParamTest.php#L152-L168), variadic arguments can be annotated in the `type ...$parameter` style. This fixes some false positive 'PhanTypeMismatchArgument' messages in analyses with phan, which in the old situation expects each parameter to be an array.
1 parent 36560ba commit ca1fe68

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/Functional/Compose.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
/**
2828
* Return a new function that composes all functions in $functions into a single callable
2929
*
30-
* @param callable[] $functions
30+
* @param callable ...$functions
3131
* @return callable
3232
* @todo Add callable typehint when HHVM supports use of typehints with variadic arguments
3333
* @see https://github.com/facebook/hhvm/issues/6954

src/Functional/PartialAny.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
* Use Functional\…, Functional\…() or Functional\placeholder() as a placeholder
3131
*
3232
* @param callable $callback
33-
* @param array $arguments
33+
* @param mixed ...$arguments
3434
* @return callable
3535
*/
3636
function partial_any(callable $callback, ...$arguments)

0 commit comments

Comments
 (0)