Conditions | 5 |
Paths | 8 |
Total Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
18 | public function getRouteKey() |
||
19 | { |
||
20 | $obscure = property_exists($this, 'obscure') && is_array($this->obscure) ? $this->obscure : config('cortex.foundation.obscure'); |
||
|
|||
21 | |||
22 | return in_array(request()->accessarea(), $obscure['areas']) |
||
23 | ? Hashids::encode($this->getAttribute($this->getKeyName()), $obscure['rotate'] ? random_int(1, 999) : 1) |
||
24 | : $this->getAttribute($this->getRouteKeyName()); |
||
25 | } |
||
26 | |||
58 |
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: