Completed
Push — master ( 83ec72...602526 )
by Bushlanov
16:59
created
src/WorkingTime.php 1 patch
Spacing   +11 added lines, -11 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 ($date === null) {
68 68
             $day = date($format, $this->dateTime->getTimestamp());
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
             $dateTime = $this->dateTime;
154 154
         } else {
155 155
             if (self::validateDate($time, 'H:i')) {
156
-                $dateTime = new \DateTime($this->dateTime->format('Y-m-d') . ' ' . $time);
156
+                $dateTime = new \DateTime($this->dateTime->format('Y-m-d').' '.$time);
157 157
             } elseif (self::validateDate($time, 'Y-m-d H:i')) {
158 158
                 $dateTime = new \DateTime($time);
159 159
             } else {
@@ -163,8 +163,8 @@  discard block
 block discarded – undo
163 163
 
164 164
         list($jobStart, $jobEnd) = explode('-', $this->workingDays[$dateTime->format('w')]);
165 165
 
166
-        $dtStart = new \DateTime($dateTime->format('Y-m-d') . ' ' . $jobStart);
167
-        $dtEnd = new \DateTime($dateTime->format('Y-m-d') . ' ' . $jobEnd);
166
+        $dtStart = new \DateTime($dateTime->format('Y-m-d').' '.$jobStart);
167
+        $dtEnd = new \DateTime($dateTime->format('Y-m-d').' '.$jobEnd);
168 168
 
169 169
         return $dateTime > $dtStart && $dateTime < $dtEnd;
170 170
     }
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
      * @param string|null $date
197 197
      * @return null|string
198 198
      */
199
-    public function nextWorkingTime(string $date = null): ?string
199
+    public function nextWorkingTime(string $date = null): ? string
200 200
     {
201 201
         $dateTime = $this->buildDate($date);
202 202
         $nextWorkingTime = null;
@@ -206,27 +206,27 @@  discard block
 block discarded – undo
206 206
             $nextWorkingDay = $this->nextWorkingDay($dateTime->format('Y-m-d'));
207 207
             $nWDateTime = new \DateTime($nextWorkingDay);
208 208
             $workTime = explode('-', $this->workingDays[$nWDateTime->format('w')]);
209
-            return $nextWorkingDay . ' ' . $workTime[0];
209
+            return $nextWorkingDay.' '.$workTime[0];
210 210
         }
211 211
 
212 212
         list($jobStart, $jobEnd) = explode('-', $this->workingDays[$dateTime->format('w')]);
213 213
 
214 214
         if ($this->isWorkingDate($dateTime->format('Y-m-d'))) { // Если день рабочий проверяем время
215 215
 
216
-            $dtStart = new \DateTime($dateTime->format('Y-m-d') . ' ' . $jobStart);
217
-            $dtEnd = new \DateTime($dateTime->format('Y-m-d') . ' ' . $jobEnd);
216
+            $dtStart = new \DateTime($dateTime->format('Y-m-d').' '.$jobStart);
217
+            $dtEnd = new \DateTime($dateTime->format('Y-m-d').' '.$jobEnd);
218 218
 
219 219
             // Если начало дня еще не наступило (утро) возвращаем указанную дату + время
220 220
             if ($dateTime < $dtStart) {
221
-                $nextWorkingTime = $dateTime->format('Y-m-d') . ' ' . $jobStart;
221
+                $nextWorkingTime = $dateTime->format('Y-m-d').' '.$jobStart;
222 222
             } elseif ($dateTime >= $dtEnd) { // Если рабочий день уже закончился
223 223
                 // Ищем следующий рабочий день и выводим его + время начало дня
224
-                $nextWorkingTime = $this->nextWorkingDay($dateTime->format('Y-m-d')) . ' ' . $jobStart;
224
+                $nextWorkingTime = $this->nextWorkingDay($dateTime->format('Y-m-d')).' '.$jobStart;
225 225
             }
226 226
         } else { // Если день не рабочий
227 227
 
228 228
             // Ищем следующий рабочий день и выводим его + время начало дня
229
-            $nextWorkingTime = $this->nextWorkingDay($dateTime->format('Y-m-d')) . ' ' . $jobStart;
229
+            $nextWorkingTime = $this->nextWorkingDay($dateTime->format('Y-m-d')).' '.$jobStart;
230 230
         }
231 231
 
232 232
         return $nextWorkingTime;
Please login to merge, or discard this patch.