Conditions | 2 |
Paths | 2 |
Total Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
7 | public function __construct($builder, $results, $isBooleanSearch = false) |
||
8 | { |
||
9 | $this->query = $builder->query; |
||
|
|||
10 | $this->isBooleanSearch = (int) $isBooleanSearch; |
||
11 | $this->indexName = $builder->index ?: $builder->model->searchableAs(); |
||
12 | $this->model = get_class($builder->model); |
||
13 | $this->ids = $results['ids']; |
||
14 | $this->hits = $results['hits']; |
||
15 | $this->execution_time = str_replace(" ms", "", $results['execution_time']); |
||
16 | $this->driver = config('scout.driver'); |
||
17 | } |
||
18 | } |
||
19 |
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: