Conditions | 4 |
Paths | 3 |
Total Lines | 24 |
Code Lines | 15 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 20 |
1 | <?php |
||
15 | public function pass(FuncCall $funcCall, Context $context) |
||
16 | { |
||
17 | $compiler = $context->getExpressionCompiler(); |
||
18 | $funcNameCompiledExpression = $compiler->compile($funcCall->name); |
||
|
|||
19 | |||
20 | if ($funcNameCompiledExpression->isString() && $funcNameCompiledExpression->isCorrectValue()) { |
||
21 | $name = $funcNameCompiledExpression->getValue(); |
||
22 | } else { |
||
23 | $context->debug( |
||
24 | 'Unexpected function name type ' . $funcNameCompiledExpression->getType(), |
||
25 | $funcCall->name |
||
26 | ); |
||
27 | |||
28 | return false; |
||
29 | } |
||
30 | |||
31 | if ($name == 'array') { |
||
32 | $context->notice( |
||
33 | 'array.short-syntax', |
||
34 | 'Please use [] (short syntax) for array definition.', |
||
35 | $funcCall |
||
36 | ); |
||
37 | } |
||
38 | } |
||
39 | } |
||
40 |
Very long variable names usually make code harder to read. It is therefore recommended not to make variable names too verbose.