| Conditions | 4 |
| Paths | 8 |
| Total Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 35 | public function resolveRouteBinding($value, $field = null) |
||
| 36 | { |
||
| 37 | $obscure = property_exists($this, 'obscure') && is_array($this->obscure) ? $this->obscure : config('cortex.foundation.obscure'); |
||
| 38 | |||
| 39 | return in_array(request()->accessarea(), $obscure['areas']) |
||
| 40 | ? $this->where($field ?? $this->getKeyName(), optional(Hashids::decode($value))[0])->first() |
||
| 41 | : $this->where($field ?? $this->getRouteKeyName(), $value)->first(); |
||
| 42 | } |
||
| 43 | |||
| 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: