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