@@ -22,7 +22,7 @@ |
||
| 22 | 22 | * |
| 23 | 23 | * @return array |
| 24 | 24 | */ |
| 25 | - public function list(?string $search): array; |
|
| 25 | + public function list(?string $search) : array; |
|
| 26 | 26 | |
| 27 | 27 | /** |
| 28 | 28 | * List time zones by region. |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | /** |
| 50 | 50 | * @return array |
| 51 | 51 | */ |
| 52 | - public function list(?string $search = ''): array |
|
| 52 | + public function list(?string $search = '') : array |
|
| 53 | 53 | { |
| 54 | 54 | $list = []; |
| 55 | 55 | foreach ($this->regions as $region) { |
@@ -195,8 +195,8 @@ discard block |
||
| 195 | 195 | */ |
| 196 | 196 | private function search(array $list, ?string $key = '', ?string $search): array |
| 197 | 197 | { |
| 198 | - return collect($list)->when(!empty($search), function (Collection $collection) use($search, $key){ |
|
| 199 | - return $collection->filter(fn($item) => Str::contains(Str::lower(!empty($key) ? $item[$key] :$item), Str::lower($search))); |
|
| 198 | + return collect($list)->when(!empty($search), function(Collection $collection) use($search, $key){ |
|
| 199 | + return $collection->filter(fn($item) => Str::contains(Str::lower(!empty($key) ? $item[$key] : $item), Str::lower($search))); |
|
| 200 | 200 | })->values()->toArray(); |
| 201 | 201 | } |
| 202 | 202 | } |
| 203 | 203 | \ No newline at end of file |