| Conditions | 1 |
| Paths | 1 |
| Total Lines | 29 |
| Code Lines | 17 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 15 | public function getDataProviderWithFunctionCallExpr() |
||
| 16 | { |
||
| 17 | $context = $this->getContext(); |
||
| 18 | $context->addVariable( |
||
| 19 | new \PHPSA\Variable( |
||
| 20 | 'variableWithFunctionName', |
||
| 21 | 'testFunctionName', |
||
| 22 | CompiledExpression::STRING |
||
| 23 | ) |
||
| 24 | ); |
||
| 25 | |||
| 26 | return [ |
||
| 27 | [ |
||
| 28 | new \PhpParser\Node\Name(['testFn']), |
||
| 29 | 'testFn', |
||
| 30 | $context |
||
| 31 | ], |
||
| 32 | [ |
||
| 33 | new \PhpParser\Node\Expr\Variable('unknown'), |
||
| 34 | false, |
||
| 35 | $context |
||
| 36 | ], |
||
| 37 | [ |
||
| 38 | new \PhpParser\Node\Expr\Variable('variableWithFunctionName'), |
||
| 39 | 'testFunctionName', |
||
| 40 | $context |
||
| 41 | ] |
||
| 42 | ]; |
||
| 43 | } |
||
| 44 | |||
| 64 |
This check looks for a call to a parent method whose name is different than the method from which it is called.
Consider the following code:
The
getFirstName()method in theSoncalls the wrong method in the parent class.