From: Vladimir Fomichev Date: Wed, 10 Dec 2025 08:22:58 +0000 (+0300) Subject: форматирование и типизация X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=639359118d9c0aaf9b31924f31300a1e62a40e2b;p=erp24_rep%2Fyii-erp24%2F.git форматирование и типизация --- diff --git a/erp24/records/Shift.php b/erp24/records/Shift.php index 054971c3..6d5a6612 100755 --- a/erp24/records/Shift.php +++ b/erp24/records/Shift.php @@ -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], + }; } }