Skip to content

Commit

Permalink
Fix php8.1 support
Browse files Browse the repository at this point in the history
  • Loading branch information
thomas-kl1 authored Apr 8, 2024
1 parent 5109b3f commit 5c8572e
Showing 1 changed file with 20 additions and 12 deletions.
32 changes: 20 additions & 12 deletions Model/Config/PathType.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?php
/**
* Copyright © OpenGento, All rights reserved.
* See LICENSE bundled with this library for license details.
*/
declare(strict_types=1);

Expand All @@ -10,21 +11,28 @@

enum PathType: string
{
private const STORE_CODE = 'store_code';
private const COUNTRY_CODE = 'country_code';
private const LANGUAGE_CODE = 'language_code';
private const LOCALE_UNDERSCORE = 'locale_underscore';
private const LOCALE_HYPHEN = 'locale_hyphen';
private const CUSTOM = 'custom';

private const PHRASES = [
self::StoreCode->value => 'Store Code',
self::CountryCode->value => 'Country Code',
self::LanguageCode->value => 'Language Code',
self::LocaleUnderscore->value => 'Locale Code (_)',
self::LocaleHyphen->value => 'Locale Code (-)',
self::Custom->value => 'Custom',
self::STORE_CODE => 'Store Code',
self::COUNTRY_CODEe => 'Country Code',
self::LANGUAGE_CODE => 'Language Code',
self::LOCALE_UNDERSCORE => 'Locale Code (_)',
self::LOCALE_HYPHEN => 'Locale Code (-)',
self::CUSTOM => 'Custom',
];

case StoreCode = 'store_code';
case CountryCode = 'country_code';
case LanguageCode = 'language_code';
case LocaleUnderscore = 'locale_underscore';
case LocaleHyphen = 'locale_hyphen';
case Custom = 'custom';
case StoreCode = self::STORE_CODE;
case CountryCode = self::COUNTRY_CODE;
case LanguageCode = self::LANGUAGE_CODE;
case LocaleUnderscore = self::LOCALE_UNDERSCORE;
case LocaleHyphen = self::LOCALE_HYPHEN;
case Custom = self::CUSTOM;

public function getLabel(): Phrase
{
Expand Down

0 comments on commit 5c8572e

Please sign in to comment.