Conditions | 4 |
Paths | 4 |
Total Lines | 14 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 4 |
Changes | 0 |
1 | <?php |
||
55 | 32 | protected function outputValidValue($value) |
|
56 | { |
||
57 | 32 | if ($value < 32) |
|
58 | { |
||
59 | 6 | return $this->escapeControlCode($value); |
|
60 | } |
||
61 | |||
62 | 26 | if ($value < 127) |
|
63 | { |
||
64 | 6 | return chr($value); |
|
65 | } |
||
66 | |||
67 | 20 | return ($value > 255) ? $this->escapeUnicode($value) : $this->escapeAscii($value); |
|
68 | } |
||
69 | } |
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: