Conditions | 3 |
Paths | 4 |
Total Lines | 14 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 12 |
Changes | 0 |
1 | <?php |
||
41 | public function compile(Buffer $buffer) |
||
42 | { |
||
43 | $this->nodes[0]->compile($buffer); |
||
44 | $buffer->raw('?'); |
||
45 | if ($this->nodes[1]) { |
||
46 | $this->nodes[1]->compile($buffer); |
||
47 | } |
||
48 | $buffer->raw(':'); |
||
49 | if ($this->nodes[2]) { |
||
50 | $this->nodes[2]->compile($buffer); |
||
51 | } else { |
||
52 | $buffer->raw('null'); |
||
53 | } |
||
54 | } |
||
55 | } |
||
56 |
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: