| Conditions | 3 |
| Paths | 3 |
| Total Lines | 12 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 44 | private function getMemberPrimaryPrefixWithChainCount(AbstractNode $memberPrimaryPrefix, $chainCount) |
||
| 45 | { |
||
| 46 | for ($chain = 0; $chain < $chainCount; $chain++) { |
||
| 47 | if (null === $memberPrimaryPrefix) { |
||
| 48 | return null; |
||
| 49 | } |
||
| 50 | |||
| 51 | $memberPrimaryPrefix = $memberPrimaryPrefix->getFirstChildOfType('MemberPrimaryPrefix'); |
||
| 52 | } |
||
| 53 | |||
| 54 | return $memberPrimaryPrefix; |
||
| 55 | } |
||
| 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.