| Conditions | 2 |
| Paths | 2 |
| Total Lines | 6 |
| Code Lines | 3 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 6 |
| Changes | 0 | ||
| 1 | <?php |
||
| 14 | public function getDeviceModelAttribute() |
||
| 15 | { |
||
| 16 | $platform = property_exists($this, 'deviceModelKey') ? $this->deviceModelKey : 'platform'; |
||
|
1 ignored issue
–
show
|
|||
| 17 | |||
| 18 | return Helper::iDeviceModel($this->{$platform}); |
||
| 19 | } |
||
| 20 | } |
||
| 21 |
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: