Conditions | 4 |
Paths | 4 |
Total Lines | 16 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 20 |
Changes | 0 |
1 | <?php |
||
28 | private function parseOptions(string $param) |
||
29 | { |
||
30 | if ($param == 'nullable') { |
||
31 | return $this->nullable = true; |
||
32 | } |
||
33 | |||
34 | if ($param == 'unique') { |
||
35 | return $this->unique = true; |
||
36 | } |
||
37 | |||
38 | if (starts_with($param, 'default(')) { |
||
39 | preg_match('/\((.*)\)/', $param, $match); |
||
40 | |||
41 | return $this->default = $match[1]; |
||
|
|||
42 | } |
||
43 | } |
||
44 | |||
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: