Conditions | 3 |
Paths | 3 |
Total Lines | 11 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
22 | public function offsetSet($offset, $value) { |
||
23 | if (is_null($offset)) { |
||
24 | $offset = $this->size; |
||
1 ignored issue
–
show
|
|||
25 | if($this->size === 0) { |
||
26 | $offset = 0; |
||
27 | } |
||
28 | $this->insert($offset, $value); |
||
1 ignored issue
–
show
|
|||
29 | } else { |
||
30 | $this->insert($offset, $value); |
||
1 ignored issue
–
show
|
|||
31 | } |
||
32 | } |
||
33 | |||
49 | } |
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: