diff --git a/src/Google/Enumerators/BarcodeRenderEncoding.php b/src/Google/Enumerators/BarcodeRenderEncoding.php index 9482b12..947f4d0 100644 --- a/src/Google/Enumerators/BarcodeRenderEncoding.php +++ b/src/Google/Enumerators/BarcodeRenderEncoding.php @@ -19,6 +19,9 @@ public static function values(): array public function mapLegacyValues(string $value): string { - return str_replace(['UTF_8'], [self::UTF_8], $value); + return match ($value) { + 'UTF_8' => self::UTF_8, + default => $value, + }; } } diff --git a/src/Google/Enumerators/BarcodeType.php b/src/Google/Enumerators/BarcodeType.php index b2455b6..8a8e1be 100644 --- a/src/Google/Enumerators/BarcodeType.php +++ b/src/Google/Enumerators/BarcodeType.php @@ -66,38 +66,23 @@ public static function values(): array public function mapLegacyValues(string $value): string { - return str_replace([ - 'aztec', - 'code39', - 'code128', - 'codabar', - 'dataMatrix', - 'ean8', - 'ean13', - 'EAN13', - 'itf14', - 'pdf417', - 'PDF417', - 'qrCode', - 'qrcode', - 'upcA', - 'textOnly', - ], [ - self::AZTEC, - self::CODE_39, - self::CODE_128, - self::CODABAR, - self::DATA_MATRIX, - self::EAN_8, - self::EAN_13, - self::EAN_13, - self::ITF_14, - self::PDF_417, - self::PDF_417, - self::QR_CODE, - self::QR_CODE, - self::UPC_A, - self::TEXT_ONLY, - ], $value); + return match ($value) { + 'aztec' => self::AZTEC, + 'code39' => self::CODE_39, + 'code128' => self::CODE_128, + 'codabar' => self::CODABAR, + 'dataMatrix' => self::DATA_MATRIX, + 'ean8' => self::EAN_8, + 'ean13' => self::EAN_13, + 'EAN13' => self::EAN_13, + 'itf14' => self::ITF_14, + 'pdf417' => self::PDF_417, + 'PDF417' => self::PDF_417, + 'qrCode' => self::QR_CODE, + 'qrcode' => self::QR_CODE, + 'upcA' => self::UPC_A, + 'textOnly' => self::TEXT_ONLY, + default => $value, + }; } } diff --git a/src/Google/Enumerators/DateFormat.php b/src/Google/Enumerators/DateFormat.php index 8614918..65b526b 100644 --- a/src/Google/Enumerators/DateFormat.php +++ b/src/Google/Enumerators/DateFormat.php @@ -38,12 +38,13 @@ public static function values(): array public function mapLegacyValues(string $value): string { - return str_replace([ - 'dateTime', - 'dateOnly', - 'timeOnly', - 'dateTimeYear', - 'dateYear', - ], [self::DATE_TIME, self::DATE_ONLY, self::TIME_ONLY, self::DATE_TIME_YEAR, self::DATE_YEAR], $value); + return match ($value) { + 'dateTime' => self::DATE_TIME, + 'dateOnly' => self::DATE_ONLY, + 'timeOnly' => self::TIME_ONLY, + 'dateTimeYear' => self::DATE_TIME_YEAR, + 'dateYear' => self::DATE_YEAR, + default => $value, + }; } } diff --git a/src/Google/Enumerators/DoorsOpenLabel.php b/src/Google/Enumerators/DoorsOpenLabel.php index 9025c53..210ae66 100644 --- a/src/Google/Enumerators/DoorsOpenLabel.php +++ b/src/Google/Enumerators/DoorsOpenLabel.php @@ -22,6 +22,10 @@ public static function values(): array public function mapLegacyValues(string $value): string { - return str_replace(['doorsOpen', 'gatesOpen'], [self::DOORS_OPEN, self::GATES_OPEN], $value); + return match ($value) { + 'doorsOpen' => self::DOORS_OPEN, + 'gatesOpen' => self::GATES_OPEN, + default => $value, + }; } } diff --git a/src/Google/Enumerators/EventTicket/ConfirmationCodeLabel.php b/src/Google/Enumerators/EventTicket/ConfirmationCodeLabel.php index 1515ed0..df27edc 100644 --- a/src/Google/Enumerators/EventTicket/ConfirmationCodeLabel.php +++ b/src/Google/Enumerators/EventTicket/ConfirmationCodeLabel.php @@ -34,11 +34,12 @@ public static function values(): array public function mapLegacyValues(string $value): string { - return str_replace(['confirmationCode', 'confirmationNumber', 'orderNumber', 'reservationNumber'], [ - self::CONFIRMATION_CODE, - self::CONFIRMATION_NUMBER, - self::ORDER_NUMBER, - self::RESERVATION_NUMBER, - ], $value); + return match ($value) { + 'confirmationCode' => self::CONFIRMATION_CODE, + 'confirmationNumber' => self::CONFIRMATION_NUMBER, + 'orderNumber' => self::ORDER_NUMBER, + 'reservationNumber' => self::RESERVATION_NUMBER, + default => $value, + }; } } diff --git a/src/Google/Enumerators/EventTicket/GateLabel.php b/src/Google/Enumerators/EventTicket/GateLabel.php index c23b09a..70bc897 100644 --- a/src/Google/Enumerators/EventTicket/GateLabel.php +++ b/src/Google/Enumerators/EventTicket/GateLabel.php @@ -25,6 +25,11 @@ public static function values(): array public function mapLegacyValues(string $value): string { - return str_replace(['gate', 'door', 'entrance'], [self::GATE, self::DOOR, self::ENTRANCE], $value); + return match ($value) { + 'gate' => self::GATE, + 'door' => self::DOOR, + 'entrance' => self::ENTRANCE, + default => $value, + }; } } diff --git a/src/Google/Enumerators/EventTicket/RowLabel.php b/src/Google/Enumerators/EventTicket/RowLabel.php index d4a3525..afd9ebf 100644 --- a/src/Google/Enumerators/EventTicket/RowLabel.php +++ b/src/Google/Enumerators/EventTicket/RowLabel.php @@ -19,6 +19,9 @@ public static function values(): array public function mapLegacyValues(string $value): string { - return str_replace(['row'], [self::ROW], $value); + return match ($value) { + 'row' => self::ROW, + default => $value, + }; } } diff --git a/src/Google/Enumerators/EventTicket/SeatLabel.php b/src/Google/Enumerators/EventTicket/SeatLabel.php index f112252..e8d0bd6 100644 --- a/src/Google/Enumerators/EventTicket/SeatLabel.php +++ b/src/Google/Enumerators/EventTicket/SeatLabel.php @@ -19,6 +19,9 @@ public static function values(): array public function mapLegacyValues(string $value): string { - return str_replace(['seat'], [self::SEAT], $value); + return match ($value) { + 'seat' => self::SEAT, + default => $value, + }; } } diff --git a/src/Google/Enumerators/EventTicket/SectionLabel.php b/src/Google/Enumerators/EventTicket/SectionLabel.php index 8488006..8da62c4 100644 --- a/src/Google/Enumerators/EventTicket/SectionLabel.php +++ b/src/Google/Enumerators/EventTicket/SectionLabel.php @@ -22,6 +22,10 @@ public static function values(): array public function mapLegacyValues(string $value): string { - return str_replace(['section', 'theater'], [self::SECTION, self::THEATER], $value); + return match ($value) { + 'section' => self::SECTION, + 'theater' => self::THEATER, + default => $value, + }; } } diff --git a/src/Google/Enumerators/Flight/BoardingDoor.php b/src/Google/Enumerators/Flight/BoardingDoor.php index ba2ce20..e8c7644 100644 --- a/src/Google/Enumerators/Flight/BoardingDoor.php +++ b/src/Google/Enumerators/Flight/BoardingDoor.php @@ -22,6 +22,10 @@ public static function values(): array public function mapLegacyValues(string $value): string { - return str_replace(['front', 'back'], [self::FRONT, self::BACK], $value); + return match ($value) { + 'front' => self::FRONT, + 'back' => self::BACK, + default => $value, + }; } } diff --git a/src/Google/Enumerators/Flight/BoardingPolicy.php b/src/Google/Enumerators/Flight/BoardingPolicy.php index 9014323..a95455f 100644 --- a/src/Google/Enumerators/Flight/BoardingPolicy.php +++ b/src/Google/Enumerators/Flight/BoardingPolicy.php @@ -30,10 +30,11 @@ public static function values(): array public function mapLegacyValues(string $value): string { - return str_replace([ - 'zoneBased', - 'groupBased', - 'boardingPolicyOther', - ], [self::ZONE_BASED, self::GROUP_BASED, self::BOARDING_POLICY_OTHER], $value); + return match ($value) { + 'zoneBased' => self::ZONE_BASED, + 'groupBased' => self::GROUP_BASED, + 'boardingPolicyOther' => self::BOARDING_POLICY_OTHER, + default => $value, + }; } } diff --git a/src/Google/Enumerators/Flight/FlightStatus.php b/src/Google/Enumerators/Flight/FlightStatus.php index a68314c..3a6fc5e 100644 --- a/src/Google/Enumerators/Flight/FlightStatus.php +++ b/src/Google/Enumerators/Flight/FlightStatus.php @@ -42,13 +42,14 @@ public static function values(): array public function mapLegacyValues(string $value): string { - return str_replace(['scheduled', 'active', 'landed', 'cancelled', 'redirected', 'diverted'], [ - self::SCHEDULED, - self::ACTIVE, - self::LANDED, - self::CANCELLED, - self::REDIRECTED, - self::DIVERTED, - ], $value); + return match ($value) { + 'scheduled' => self::SCHEDULED, + 'active' => self::ACTIVE, + 'landed' => self::LANDED, + 'cancelled' => self::CANCELLED, + 'redirected' => self::REDIRECTED, + 'diverted' => self::DIVERTED, + default => $value, + }; } } diff --git a/src/Google/Enumerators/Flight/SeatClassPolicy.php b/src/Google/Enumerators/Flight/SeatClassPolicy.php index d8641a0..7c13a27 100644 --- a/src/Google/Enumerators/Flight/SeatClassPolicy.php +++ b/src/Google/Enumerators/Flight/SeatClassPolicy.php @@ -34,11 +34,12 @@ public static function values(): array public function mapLegacyValues(string $value): string { - return str_replace([ - 'cabinBased', - 'classBased', - 'tierBased', - 'seatClassPolicyOther', - ], [self::CABIN_BASED, self::CLASS_BASED, self::TIER_BASED, self::SEAT_CLASS_POLICY_OTHER], $value); + return match ($value) { + 'cabinBased' => self::CABIN_BASED, + 'classBased' => self::CLASS_BASED, + 'tierBased' => self::TIER_BASED, + 'seatClassPolicyOther' => self::SEAT_CLASS_POLICY_OTHER, + default => $value, + }; } } diff --git a/src/Google/Enumerators/Loyalty/VisibilityState.php b/src/Google/Enumerators/Loyalty/VisibilityState.php index c87e52c..c31cde0 100644 --- a/src/Google/Enumerators/Loyalty/VisibilityState.php +++ b/src/Google/Enumerators/Loyalty/VisibilityState.php @@ -25,10 +25,11 @@ public static function values(): array public function mapLegacyValues(string $value): string { - return str_replace([ - 'trustedTesters', - 'live', - 'disabled', - ], [self::TRUSTED_TESTERS, self::LIVE, self::DISABLED], $value); + return match ($value) { + 'trustedTesters' => self::TRUSTED_TESTERS, + 'live' => self::LIVE, + 'disabled' => self::DISABLED, + default => $value, + }; } } diff --git a/src/Google/Enumerators/MessageType.php b/src/Google/Enumerators/MessageType.php index cc34693..3fe05aa 100644 --- a/src/Google/Enumerators/MessageType.php +++ b/src/Google/Enumerators/MessageType.php @@ -22,9 +22,10 @@ public static function values(): array public function mapLegacyValues(string $value): string { - return str_replace([ - 'text', - 'expirationNotification', - ], [self::TEXT, self::EXPIRATION_NOTIFICATION], $value); + return match ($value) { + 'text' => self::TEXT, + 'expirationNotification' => self::EXPIRATION_NOTIFICATION, + default => $value, + }; } } diff --git a/src/Google/Enumerators/MultipleDevicesAndHoldersAllowedStatus.php b/src/Google/Enumerators/MultipleDevicesAndHoldersAllowedStatus.php index a5a70b0..d145387 100644 --- a/src/Google/Enumerators/MultipleDevicesAndHoldersAllowedStatus.php +++ b/src/Google/Enumerators/MultipleDevicesAndHoldersAllowedStatus.php @@ -30,10 +30,11 @@ public static function values(): array public function mapLegacyValues(string $value): string { - return str_replace([ - 'multipleHolders', - 'oneUserAllDevices', - 'oneUserOneDevice', - ], [self::MULTIPLE_HOLDERS, self::ONE_USER_ALL_DEVICES, self::ONE_USER_ONE_DEVICE], $value); + return match ($value) { + 'multipleHolders' => self::MULTIPLE_HOLDERS, + 'oneUserAllDevices' => self::ONE_USER_ALL_DEVICES, + 'oneUserOneDevice' => self::ONE_USER_ONE_DEVICE, + default => $value, + }; } } diff --git a/src/Google/Enumerators/Offer/RedemptionChannel.php b/src/Google/Enumerators/Offer/RedemptionChannel.php index b10493f..65115b7 100644 --- a/src/Google/Enumerators/Offer/RedemptionChannel.php +++ b/src/Google/Enumerators/Offer/RedemptionChannel.php @@ -34,11 +34,12 @@ public static function values(): array public function mapLegacyValues(string $value): string { - return str_replace([ - 'instore', - 'online', - 'both', - 'temporaryPriceReduction', - ], [self::INSTORE, self::ONLINE, self::BOTH, self::TEMPORARY_PRICE_REDUCTION], $value); + return match ($value) { + 'instore' => self::INSTORE, + 'online' => self::ONLINE, + 'both' => self::BOTH, + 'temporaryPriceReduction' => self::TEMPORARY_PRICE_REDUCTION, + default => $value, + }; } } diff --git a/src/Google/Enumerators/PredefinedItem.php b/src/Google/Enumerators/PredefinedItem.php index 46c7e1c..78f1df2 100644 --- a/src/Google/Enumerators/PredefinedItem.php +++ b/src/Google/Enumerators/PredefinedItem.php @@ -26,9 +26,10 @@ public static function values(): array public function mapLegacyValues(string $value): string { - return str_replace(['frequentFlyerProgramNameAndNumber', 'flightNumberAndOperatingFlightNumber'], [ - self::FREQUENT_FLYER_PROGRAM_NAME_AND_NUMBER, - self::FLIGHT_NUMBER_AND_OPERATING_FLIGHT_NUMBER, - ], $value); + return match ($value) { + 'frequentFlyerProgramNameAndNumber' => self::FREQUENT_FLYER_PROGRAM_NAME_AND_NUMBER, + 'flightNumberAndOperatingFlightNumber' => self::FLIGHT_NUMBER_AND_OPERATING_FLIGHT_NUMBER, + default => $value, + }; } } diff --git a/src/Google/Enumerators/ReviewStatus.php b/src/Google/Enumerators/ReviewStatus.php index 5c5e978..927f0da 100644 --- a/src/Google/Enumerators/ReviewStatus.php +++ b/src/Google/Enumerators/ReviewStatus.php @@ -28,11 +28,12 @@ public static function values(): array public function mapLegacyValues(string $value): string { - return str_replace([ - 'underReview', - 'approved', - 'rejected', - 'draft', - ], [self::UNDER_REVIEW, self::APPROVED, self::REJECTED, self::DRAFT], $value); + return match ($value) { + 'underReview' => self::UNDER_REVIEW, + 'approved' => self::APPROVED, + 'rejected' => self::REJECTED, + 'draft' => self::DRAFT, + default => $value, + }; } } diff --git a/src/Google/Enumerators/State.php b/src/Google/Enumerators/State.php index 555072d..f988222 100644 --- a/src/Google/Enumerators/State.php +++ b/src/Google/Enumerators/State.php @@ -28,11 +28,12 @@ public static function values(): array public function mapLegacyValues(string $value): string { - return str_replace([ - 'active', - 'completed', - 'expired', - 'inactive', - ], [self::ACTIVE, self::COMPLETED, self::EXPIRED, self::INACTIVE], $value); + return match ($value) { + 'active' => self::ACTIVE, + 'completed' => self::COMPLETED, + 'expired' => self::EXPIRED, + 'inactive' => self::INACTIVE, + default => $value, + }; } } diff --git a/src/Google/Enumerators/Transit/ConcessionCategory.php b/src/Google/Enumerators/Transit/ConcessionCategory.php index 004fcea..63c7d97 100644 --- a/src/Google/Enumerators/Transit/ConcessionCategory.php +++ b/src/Google/Enumerators/Transit/ConcessionCategory.php @@ -25,6 +25,11 @@ public static function values(): array public function mapLegacyValues(string $value): string { - return str_replace(['adult', 'child', 'senior'], [self::ADULT, self::CHILD, self::SENIOR], $value); + return match ($value) { + 'adult' => self::ADULT, + 'child' => self::CHILD, + 'senior' => self::SENIOR, + default => $value, + }; } } diff --git a/src/Google/Enumerators/Transit/FareClass.php b/src/Google/Enumerators/Transit/FareClass.php index bdb0f6e..b109807 100644 --- a/src/Google/Enumerators/Transit/FareClass.php +++ b/src/Google/Enumerators/Transit/FareClass.php @@ -25,6 +25,11 @@ public static function values(): array public function mapLegacyValues(string $value): string { - return str_replace(['economy', 'first', 'business'], [self::ECONOMY, self::FIRST, self::BUSINESS], $value); + return match ($value) { + 'economy' => self::ECONOMY, + 'first' => self::FIRST, + 'business' => self::BUSINESS, + default => $value, + }; } } diff --git a/src/Google/Enumerators/Transit/PassengerType.php b/src/Google/Enumerators/Transit/PassengerType.php index 7f60ce8..1e53312 100644 --- a/src/Google/Enumerators/Transit/PassengerType.php +++ b/src/Google/Enumerators/Transit/PassengerType.php @@ -22,9 +22,10 @@ public static function values(): array public function mapLegacyValues(string $value): string { - return str_replace([ - 'singlePassenger', - 'multiplePassengers', - ], [self::SINGLE_PASSENGER, self::MULTIPLE_PASSENGERS], $value); + return match ($value) { + 'singlePassenger' => self::SINGLE_PASSENGER, + 'multiplePassengers' => self::MULTIPLE_PASSENGERS, + default => $value, + }; } } diff --git a/src/Google/Enumerators/Transit/TicketStatus.php b/src/Google/Enumerators/Transit/TicketStatus.php index 496a750..82f3f0e 100644 --- a/src/Google/Enumerators/Transit/TicketStatus.php +++ b/src/Google/Enumerators/Transit/TicketStatus.php @@ -25,10 +25,11 @@ public static function values(): array public function mapLegacyValues(string $value): string { - return str_replace([ - 'used', - 'refunded', - 'exchanged', - ], [self::USED, self::REFUNDED, self::EXCHANGED], $value); + return match ($value) { + 'used' => self::USED, + 'refunded' => self::REFUNDED, + 'exchanged' => self::EXCHANGED, + default => $value, + }; } } diff --git a/src/Google/Enumerators/Transit/TransitType.php b/src/Google/Enumerators/Transit/TransitType.php index 1506610..b2ab353 100644 --- a/src/Google/Enumerators/Transit/TransitType.php +++ b/src/Google/Enumerators/Transit/TransitType.php @@ -31,12 +31,13 @@ public static function values(): array public function mapLegacyValues(string $value): string { - return str_replace([ - 'bus', - 'rail', - 'tram', - 'ferry', - 'other', - ], [self::BUS, self::RAIL, self::TRAM, self::FERRY, self::OTHER], $value); + return match ($value) { + 'bus' => self::BUS, + 'rail' => self::RAIL, + 'tram' => self::TRAM, + 'ferry' => self::FERRY, + 'other' => self::OTHER, + default => $value, + }; } } diff --git a/src/Google/Enumerators/Transit/TripType.php b/src/Google/Enumerators/Transit/TripType.php index 3bc065c..8e25b74 100644 --- a/src/Google/Enumerators/Transit/TripType.php +++ b/src/Google/Enumerators/Transit/TripType.php @@ -22,6 +22,10 @@ public static function values(): array public function mapLegacyValues(string $value): string { - return str_replace(['roundTrip', 'oneWay'], [self::ROUND_TRIP, self::ONE_WAY], $value); + return match ($value) { + 'roundTrip' => self::ROUND_TRIP, + 'oneWay' => self::ONE_WAY, + default => $value, + }; } } diff --git a/src/Google/Enumerators/TransitOption.php b/src/Google/Enumerators/TransitOption.php index 60d8af2..65a3062 100644 --- a/src/Google/Enumerators/TransitOption.php +++ b/src/Google/Enumerators/TransitOption.php @@ -30,10 +30,11 @@ public static function values(): array public function mapLegacyValues(string $value): string { - return str_replace([ - 'originAndDestinationNames', - 'originAndDestinationCodes', - 'originName', - ], [self::ORIGIN_AND_DESTINATION_NAMES, self::ORIGIN_AND_DESTINATION_CODES, self::ORIGIN_NAME], $value); + return match ($value) { + 'originAndDestinationNames' => self::ORIGIN_AND_DESTINATION_NAMES, + 'originAndDestinationCodes' => self::ORIGIN_AND_DESTINATION_CODES, + 'originName' => self::ORIGIN_NAME, + default => $value, + }; } }