@@ -3,6 +3,6 @@ |
||
| 3 | 3 | return [ |
| 4 | 4 | 'DEFAULT_TIME_ZONE' => 'GMT', //GMT or UTC |
| 5 | 5 | 'TIME_DIFF_SYMBOL' => '.', //+00.00 |
| 6 | - 'LABEL_FIELD_NAME' => 'label' , |
|
| 6 | + 'LABEL_FIELD_NAME' => 'label', |
|
| 7 | 7 | 'VALUE_FIELD_NAME' => 'value' |
| 8 | 8 | ]; |
@@ -3,7 +3,7 @@ |
||
| 3 | 3 | namespace Joy2362\PhpTimezone; |
| 4 | 4 | |
| 5 | 5 | use Illuminate\Support\ServiceProvider; |
| 6 | -use Joy2362\PhpTimezone\{Contract\TimeZoneManager,Service\TimeZoneService}; |
|
| 6 | +use Joy2362\PhpTimezone\{Contract\TimeZoneManager, Service\TimeZoneService}; |
|
| 7 | 7 | |
| 8 | 8 | class PhpTimeZoneServiceProvider extends ServiceProvider |
| 9 | 9 | { |
@@ -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 |