Conditions | 5 |
Paths | 4 |
Total Lines | 16 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
25 | protected function hasOption(string $name): bool |
||
26 | { |
||
27 | if (array_key_exists($name, $this->options)) { |
||
28 | return true; |
||
29 | } |
||
30 | |||
31 | if (!isset($this->aliases) || !isset($this->aliases[$name])) { |
||
1 ignored issue
–
show
|
|||
32 | return false; |
||
33 | } |
||
34 | |||
35 | foreach ($this->aliases[$name] as $name) { |
||
36 | return $this->hasOption($name); |
||
37 | } |
||
38 | |||
39 | return false; |
||
40 | } |
||
41 | |||
68 | } |
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: