| 1 | <?php |
||
| 14 | class MemberPrimaryPrefix extends AbstractRule implements ClassAware |
||
| 15 | { |
||
| 16 | use TestGuesser; |
||
| 17 | |||
| 18 | /** |
||
| 19 | * @param AbstractNode|ClassNode $node |
||
| 20 | */ |
||
| 21 | public function apply(AbstractNode $node) |
||
| 37 | |||
| 38 | /** |
||
| 39 | * @param AbstractNode $memberPrimaryPrefix |
||
| 40 | * @param int $chainCount |
||
| 41 | * |
||
| 42 | * @return null|AbstractNode |
||
| 43 | */ |
||
| 44 | private function getMemberPrimaryPrefixWithChainCount(AbstractNode $memberPrimaryPrefix, $chainCount) |
||
| 56 | } |
||
| 57 |
This check looks for parameters that are defined as one type in their type hint or doc comment but seem to be used as a narrower type, i.e an implementation of an interface or a subclass.
Consider changing the type of the parameter or doing an instanceof check before assuming your parameter is of the expected type.