| Conditions | 1 |
| Paths | 1 |
| Total Lines | 6 |
| Code Lines | 3 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 12 | protected function setSlug($property) |
||
| 13 | { |
||
| 14 | $slug = str_replace(' ', '_', $this->{$property}); |
||
| 15 | |||
| 16 | $this->slug = strtolower($slug); |
||
|
1 ignored issue
–
show
|
|||
| 17 | } |
||
| 18 | } |
||
| 19 |
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: