]> gitweb.erp-flowers.ru Git - erp24_rep/yii-erp24/.git/commitdiff
форматирование и типизация
authorVladimir Fomichev <vladimir.fomichev@erp-flowers.ru>
Wed, 10 Dec 2025 08:22:58 +0000 (11:22 +0300)
committerVladimir Fomichev <vladimir.fomichev@erp-flowers.ru>
Wed, 10 Dec 2025 08:22:58 +0000 (11:22 +0300)
erp24/records/Shift.php

index 054971c37362046fb6eebfb1b51ad2a72697f4bc..6d5a661233e4ad4b7efd8edd6978d637f0186d1c 100755 (executable)
@@ -113,7 +113,12 @@ class Shift extends ActiveRecord
         return Shift::NIGHT === (int) $shiftId ;
     }
 
-    public static function getShiftIdsByShiftType ($shiftType) {
-        return $shiftType == 0 ? [self::DAY, self::NIGHT, self::ADMINISTRATOR_8_17, self::ADMINISTRATOR_9_18] : ($shiftType == self::DAY ? [self::DAY, self::ADMINISTRATOR_8_17, self::ADMINISTRATOR_9_18] : [self::NIGHT]);
+    public static function getShiftIdsByShiftType(int $shiftType): array
+    {
+        return match ($shiftType) {
+            self::DAY => [self::DAY, self::ADMINISTRATOR_8_17, self::ADMINISTRATOR_9_18],
+            self::NIGHT => [self::NIGHT],
+            default => [self::DAY, self::NIGHT, self::ADMINISTRATOR_8_17, self::ADMINISTRATOR_9_18],
+        };
     }
 }