Passed
Branch 1.3.x (d59c40)
by Abdullah
02:18
created
src/TimeZoneService.php 2 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -140,9 +140,9 @@  discard block
 block discarded – undo
140 140
     }
141 141
 
142 142
     /**
143
-    * @param $time
144
-    * @return string
145
-    */
143
+     * @param $time
144
+     * @return string
145
+     */
146 146
     private function getZone($time): string
147 147
     {
148 148
         return str_replace('_', ' ', $time->format('e'));
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
      * @param bool $isLabel
154 154
      * @param bool $isValue
155 155
      * @return array
156
-    */
156
+     */
157 157
     private function getTimeZoneList(array $timezones , bool $isLabel = true , bool $isValue = true): array
158 158
     {
159 159
         $label = Config::get('Timezone.LABEL_FIELD_NAME','label');
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
     {
65 65
         $list = [];
66 66
         foreach ($this->regions as $region) {
67
-            $list[] = $this->getTimeZoneList(DateTimeZone::listIdentifiers($region) ?? [] , false);
67
+            $list[] = $this->getTimeZoneList(DateTimeZone::listIdentifiers($region) ?? [], false);
68 68
         }
69 69
         return $list;
70 70
     }
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
     {
77 77
         $list = [];
78 78
         foreach ($this->regions as $region) {
79
-            $list[] = $this->getTimeZoneList(DateTimeZone::listIdentifiers($region) ?? [] , true , false);
79
+            $list[] = $this->getTimeZoneList(DateTimeZone::listIdentifiers($region) ?? [], true, false);
80 80
         }
81 81
         return $list;
82 82
     }
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
             $time_diff = $this->getTimeDiff($time);
121 121
             $zone = $this->getZone($time);
122 122
             
123
-            $defaultTimeZone = Config::get('Timezone.DEFAULT_TIME_ZONE' , 'GMT');
123
+            $defaultTimeZone = Config::get('Timezone.DEFAULT_TIME_ZONE', 'GMT');
124 124
             $defaultTimeZone = in_array($defaultTimeZone, $this->supportedTimeZone) ? $defaultTimeZone : $this->supportedTimeZone[0];
125 125
             return "({$defaultTimeZone} {$time_diff}) {$zone}";
126 126
         } catch (Exception $ex) {
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
      */
135 135
     private function getTimeDiff($time): string
136 136
     {
137
-        $time_diff_symbol = Config::get('Timezone.TIME_DIFF_SYMBOL','.');
137
+        $time_diff_symbol = Config::get('Timezone.TIME_DIFF_SYMBOL', '.');
138 138
         $str_time_diff = $time->format('p');
139 139
         return str_replace(':', $time_diff_symbol, $str_time_diff);
140 140
     }
@@ -154,19 +154,19 @@  discard block
 block discarded – undo
154 154
      * @param bool $isValue
155 155
      * @return array
156 156
     */
157
-    private function getTimeZoneList(array $timezones , bool $isLabel = true , bool $isValue = true): array
157
+    private function getTimeZoneList(array $timezones, bool $isLabel = true, bool $isValue = true): array
158 158
     {
159
-        $label = Config::get('Timezone.LABEL_FIELD_NAME','label');
160
-        $value = Config::get('Timezone.VALUE_FIELD_NAME','value');
159
+        $label = Config::get('Timezone.LABEL_FIELD_NAME', 'label');
160
+        $value = Config::get('Timezone.VALUE_FIELD_NAME', 'value');
161 161
         
162 162
         $data = [];
163 163
 
164 164
         foreach ($timezones as $timezone) {
165
-            if($isLabel ){
165
+            if ($isLabel) {
166 166
                 $data[$label] = $this->getLabel($timezone);
167 167
             }
168 168
 
169
-            if($isValue ){
169
+            if ($isValue) {
170 170
                 $data[$value] = $timezone;
171 171
             }
172 172
             
Please login to merge, or discard this patch.