Passed
Branch master (c53e22)
by Bushlanov
02:01
created
src/WorkingTime.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
      * @param string $format
63 63
      * @return string
64 64
      */
65
-    private function buildDataPartString(?string $date, string $format): string
65
+    private function buildDataPartString(? string $date, string $format) : string
66 66
     {
67 67
         if (null === $date) {
68 68
             $day = date($format, $this->dateTime->getTimestamp());
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
             $dateTime = $this->dateTime;
146 146
         } else {
147 147
             if (self::validateDate($time, 'H:i')) {
148
-                $dateTime = new \DateTime($this->dateTime->format('Y-m-d') . ' ' . $time);
148
+                $dateTime = new \DateTime($this->dateTime->format('Y-m-d').' '.$time);
149 149
             } elseif (self::validateDate($time, 'Y-m-d H:i')) {
150 150
                 $dateTime = new \DateTime($time);
151 151
             } else {
@@ -155,8 +155,8 @@  discard block
 block discarded – undo
155 155
 
156 156
         [$jobStart, $jobEnd] = explode('-', $this->workingDays[$dateTime->format('w')]);
157 157
 
158
-        $dtStart = new \DateTime($dateTime->format('Y-m-d') . ' ' . $jobStart);
159
-        $dtEnd = new \DateTime($dateTime->format('Y-m-d') . ' ' . $jobEnd);
158
+        $dtStart = new \DateTime($dateTime->format('Y-m-d').' '.$jobStart);
159
+        $dtEnd = new \DateTime($dateTime->format('Y-m-d').' '.$jobEnd);
160 160
 
161 161
         return $dateTime > $dtStart && $dateTime < $dtEnd;
162 162
     }
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
      * @param string|null $date
189 189
      * @return null|string
190 190
      */
191
-    public function nextWorkingTime(string $date = null): ?string
191
+    public function nextWorkingTime(string $date = null): ? string
192 192
     {
193 193
         $dateTime = $this->buildDate($date);
194 194
         $nextWorkingTime = null;
@@ -198,27 +198,27 @@  discard block
 block discarded – undo
198 198
             $nextWorkingDay = $this->nextWorkingDay($dateTime->format('Y-m-d'));
199 199
             $nWDateTime = new \DateTime($nextWorkingDay);
200 200
             $workTime = explode('-', $this->workingDays[$nWDateTime->format('w')]);
201
-            return $nextWorkingDay . ' ' . $workTime[0];
201
+            return $nextWorkingDay.' '.$workTime[0];
202 202
         }
203 203
 
204 204
         [$jobStart, $jobEnd] = explode('-', $this->workingDays[$dateTime->format('w')]);
205 205
 
206 206
         if ($this->isWorkingDate($dateTime->format('Y-m-d'))) { // Если день рабочий проверяем время
207 207
 
208
-            $dtStart = new \DateTime($dateTime->format('Y-m-d') . ' ' . $jobStart);
209
-            $dtEnd = new \DateTime($dateTime->format('Y-m-d') . ' ' . $jobEnd);
208
+            $dtStart = new \DateTime($dateTime->format('Y-m-d').' '.$jobStart);
209
+            $dtEnd = new \DateTime($dateTime->format('Y-m-d').' '.$jobEnd);
210 210
 
211 211
             // Если начало дня еще не наступило (утро) возвращаем указанную дату + время
212 212
             if ($dateTime < $dtStart) {
213
-                $nextWorkingTime = $dateTime->format('Y-m-d') . ' ' . $jobStart;
213
+                $nextWorkingTime = $dateTime->format('Y-m-d').' '.$jobStart;
214 214
             } elseif ($dateTime >= $dtEnd) { // Если рабочий день уже закончился
215 215
                 // Ищем следующий рабочий день и выводим его + время начало дня
216
-                $nextWorkingTime = $this->nextWorkingDay($dateTime->format('Y-m-d')) . ' ' . $jobStart;
216
+                $nextWorkingTime = $this->nextWorkingDay($dateTime->format('Y-m-d')).' '.$jobStart;
217 217
             }
218 218
         } else { // Если день не рабочий
219 219
 
220 220
             // Ищем следующий рабочий день и выводим его + время начало дня
221
-            $nextWorkingTime = $this->nextWorkingDay($dateTime->format('Y-m-d')) . ' ' . $jobStart;
221
+            $nextWorkingTime = $this->nextWorkingDay($dateTime->format('Y-m-d')).' '.$jobStart;
222 222
         }
223 223
 
224 224
         return $nextWorkingTime;
@@ -236,7 +236,7 @@  discard block
 block discarded – undo
236 236
         $day = $nextWorkingDayDT->format('w');
237 237
         $jobStart = explode('-', $this->workingDays[$day])[0];
238 238
 
239
-        return $nextWorkingDayDT->format('Y-m-d') . ' ' . $jobStart;
239
+        return $nextWorkingDayDT->format('Y-m-d').' '.$jobStart;
240 240
     }
241 241
 
242 242
     /**
@@ -251,7 +251,7 @@  discard block
 block discarded – undo
251 251
         $day = $nextWorkingDayDT->format('w');
252 252
         $jobEnd = explode('-', $this->workingDays[$day])[1];
253 253
 
254
-        return $nextWorkingDayDT->format('Y-m-d') . ' ' . $jobEnd;
254
+        return $nextWorkingDayDT->format('Y-m-d').' '.$jobEnd;
255 255
     }
256 256
 
257 257
     /**
Please login to merge, or discard this patch.