| Conditions | 3 |
| Paths | 3 |
| Total Lines | 15 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 3 |
| CRAP Score | 6.4624 |
| Changes | 2 | ||
| Bugs | 1 | Features | 0 |
| 1 | <?php |
||
| 22 | 1 | public function pass($stmt, Context $context) |
|
| 23 | { |
||
| 24 | 1 | if ($stmt->default instanceof Node\Expr) { |
|
| 25 | $compiled = $context->getExpressionCompiler()->compile($stmt->default); |
||
| 26 | if ($compiled->getType() == CompiledExpression::NULL) { |
||
| 27 | $context->notice( |
||
| 28 | 'property_definition_default_value', |
||
| 29 | 'null is default and is not needed.', |
||
| 30 | $stmt |
||
| 31 | ); |
||
| 32 | return true; |
||
| 33 | } |
||
| 34 | } |
||
| 35 | 1 | return false; |
|
| 36 | } |
||
| 37 | |||
| 48 |