Conditions | 1 |
Paths | 1 |
Total Lines | 10 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
40 | public function compile(Buffer $buffer) |
||
41 | { |
||
42 | $name = explode('.', $this->name); |
||
43 | $phpName = Util::toPhp($name); |
||
44 | |||
45 | $buffer->write('$z->set(')->raw($phpName)->raw(', '); |
||
46 | $buffer->raw('$z->value('); |
||
47 | $this->nodes[0]->compile($buffer); |
||
48 | $buffer->raw('));')->eol(); |
||
49 | } |
||
50 | } |
||
51 |
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: