Passed
Push — main ( ef9dce...6811be )
by Abdullah
01:44
created
src/config/config.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -3,6 +3,6 @@
 block discarded – undo
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
 ];
Please login to merge, or discard this patch.
src/PhpTimeZoneServiceProvider.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@
 block discarded – undo
22 22
     public function register()
23 23
     {
24 24
         $this->mergeConfigFrom(__DIR__.'/config/config.php', 'Timezone');
25
-        $this->app->bind('TimeZoneService', function () {
25
+        $this->app->bind('TimeZoneService', function() {
26 26
             return new TimeZoneService();
27 27
         });
28 28
 
Please login to merge, or discard this patch.
src/TimeZoneService.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -56,8 +56,8 @@  discard block
 block discarded – undo
56 56
     {
57 57
         $list = [];
58 58
         
59
-        $label = Config::get('Timezone.LABEL_FIELD_NAME','label');
60
-        $value = Config::get('Timezone.VALUE_FIELD_NAME','value');
59
+        $label = Config::get('Timezone.LABEL_FIELD_NAME', 'label');
60
+        $value = Config::get('Timezone.VALUE_FIELD_NAME', 'value');
61 61
 
62 62
         foreach ($this->regions as $region) {
63 63
             $timezones = DateTimeZone::listIdentifiers($region);
@@ -110,8 +110,8 @@  discard block
 block discarded – undo
110 110
             return [];
111 111
         }
112 112
         $list = [];
113
-        $label = Config::get('Timezone.LABEL_FIELD_NAME','label');
114
-        $value = Config::get('Timezone.VALUE_FIELD_NAME','value');
113
+        $label = Config::get('Timezone.LABEL_FIELD_NAME', 'label');
114
+        $value = Config::get('Timezone.VALUE_FIELD_NAME', 'value');
115 115
 
116 116
         $timezones = DateTimeZone::listIdentifiers($this->regions[$region]);
117 117
         foreach ($timezones as $timezone) {
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
             $time_diff = $this->getTimeDiff($time);
154 154
             $zone = $this->getZone($time);
155 155
             
156
-            $defaultTimeZone = Config::get('Timezone.DEFAULT_TIME_ZONE' , 'GMT');
156
+            $defaultTimeZone = Config::get('Timezone.DEFAULT_TIME_ZONE', 'GMT');
157 157
             $defaultTimeZone = in_array($defaultTimeZone, $this->supportedTimeZone) ? $defaultTimeZone : $this->supportedTimeZone[0];
158 158
             return "({$defaultTimeZone} {$time_diff}) {$zone}";
159 159
         } catch (Exception $ex) {
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
      */
168 168
     private function getTimeDiff($time): string
169 169
     {
170
-        $time_diff_symbol = Config::get('Timezone.TIME_DIFF_SYMBOL','.');
170
+        $time_diff_symbol = Config::get('Timezone.TIME_DIFF_SYMBOL', '.');
171 171
         $str_time_diff = $time->format('p');
172 172
         return str_replace(':', $time_diff_symbol, $str_time_diff);
173 173
     }
Please login to merge, or discard this patch.