| Conditions | 3 |
| Paths | 4 |
| Total Lines | 16 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 24 | public function search($search) |
||
| 25 | { |
||
| 26 | if (func_num_args() > 1) { |
||
| 27 | $this->search = func_get_args(); |
||
| 28 | } else { |
||
| 29 | $this->search = $search; |
||
| 30 | } |
||
| 31 | |||
| 32 | if ($query = request()->get(static::$searchKey)) { |
||
| 33 | $this->applySearch($query); |
||
| 34 | } |
||
| 35 | |||
| 36 | $this->tools->append(new SearchBar()); |
||
|
|
|||
| 37 | |||
| 38 | return $this; |
||
| 39 | } |
||
| 40 | |||
| 69 | } |
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: