| Conditions | 4 |
| Paths | 3 |
| Total Lines | 24 |
| Code Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 20 |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 21 | public function pass(FuncCall $funcCall, Context $context) |
||
| 22 | { |
||
| 23 | $compiler = $context->getExpressionCompiler(); |
||
| 24 | $funcNameCompiledExpression = $compiler->compile($funcCall->name); |
||
|
|
|||
| 25 | |||
| 26 | if ($funcNameCompiledExpression->isString() && $funcNameCompiledExpression->isCorrectValue()) { |
||
| 27 | $name = $funcNameCompiledExpression->getValue(); |
||
| 28 | } else { |
||
| 29 | $context->debug( |
||
| 30 | 'Unexpected function name type ' . $funcNameCompiledExpression->getType(), |
||
| 31 | $funcCall->name |
||
| 32 | ); |
||
| 33 | |||
| 34 | return false; |
||
| 35 | } |
||
| 36 | |||
| 37 | if (isset($this->map[$name])) { |
||
| 38 | $context->notice( |
||
| 39 | 'rand.api.migration', |
||
| 40 | sprintf('Function %s() is not recommended, please use mt_%s analog instead of it.', $name, $name), |
||
| 41 | $funcCall |
||
| 42 | ); |
||
| 43 | } |
||
| 44 | } |
||
| 45 | } |
||
| 46 |
Very long variable names usually make code harder to read. It is therefore recommended not to make variable names too verbose.