Conditions | 4 |
Paths | 8 |
Total Lines | 18 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
23 | public function searchPanes($value = true) |
||
24 | { |
||
25 | if (is_callable($value)) { |
||
26 | $value = app()->call($value); |
||
27 | } |
||
28 | |||
29 | if ($value instanceof Arrayable) { |
||
30 | $value = $value->toArray(); |
||
31 | } |
||
32 | |||
33 | if (is_bool($value)) { |
||
34 | $value = SearchPane::make()->show($value)->toArray(); |
||
35 | } |
||
36 | |||
37 | $this->attributes['searchPanes'] = $value; |
||
|
|||
38 | |||
39 | return $this; |
||
40 | } |
||
41 | } |
||
42 |
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: