| Conditions | 3 |
| Paths | 3 |
| Total Lines | 15 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 12 |
| Changes | 0 | ||
| 1 | <?php |
||
| 31 | public function toUpdate(Collection $searchables): Collection |
||
| 32 | { |
||
| 33 | $result = []; |
||
| 34 | |||
| 35 | foreach ($searchables as $key => $searchable) { |
||
| 36 | if (empty($array = array_merge($searchable->toSearchableArray(), $searchable->scoutMetadata()))) { |
||
| 37 | continue; |
||
| 38 | } |
||
| 39 | |||
| 40 | $array['objectID'] = $searchable->getScoutKey(); |
||
| 41 | |||
| 42 | $result[] = $array; |
||
| 43 | } |
||
| 44 | |||
| 45 | return collect($result); |
||
| 46 | } |
||
| 48 |