| Conditions | 3 |
| Paths | 3 |
| Total Lines | 13 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 9 | 6 | private function writeValue(ValueInterface $model) { |
|
| 10 | 6 | if ($model->isExpression()) { |
|
| 11 | 4 | $this->writer->write($model->getExpression()); |
|
|
1 ignored issue
–
show
|
|||
| 12 | } else { |
||
| 13 | 6 | $value = $model->getValue(); |
|
| 14 | |||
| 15 | 6 | if ($value instanceof PhpConstant) { |
|
| 16 | 3 | $this->writer->write($value->getName()); |
|
| 17 | } else { |
||
| 18 | 6 | $this->writer->write($this->exportVar($value)); |
|
| 19 | } |
||
| 20 | } |
||
| 21 | 6 | } |
|
| 22 | |||
| 31 | } |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: