| 1 | <?php |
||
| 13 | class ReturnAndYieldInOneMethod implements Pass\AnalyzerPassInterface |
||
| 14 | { |
||
| 15 | const DESCRIPTION = 'Checks for using return and yield statements in a one method and discourages it.'; |
||
| 16 | |||
| 17 | use DefaultMetadataPassTrait; |
||
| 18 | use ResolveExpressionTrait; |
||
| 19 | |||
| 20 | /** |
||
| 21 | * @param Node\FunctionLike $func |
||
| 22 | * @param Context $context |
||
| 23 | * @return bool |
||
| 24 | */ |
||
| 25 | 8 | public function pass(Node\FunctionLike $func, Context $context) |
|
| 44 | |||
| 45 | /** |
||
| 46 | * @return array |
||
| 47 | */ |
||
| 48 | 2 | public function getRegister() |
|
| 54 | } |
||
| 55 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: