| Total Complexity | 3 |
| Total Lines | 52 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 18 | class AbstractEnumType extends BaseEnumType |
||
| 19 | { |
||
| 20 | /** |
||
| 21 | * Set deprecations reasons for deprecated values |
||
| 22 | * |
||
| 23 | * @var array |
||
| 24 | */ |
||
| 25 | protected static $deprecatedReasons = []; |
||
| 26 | |||
| 27 | /** |
||
| 28 | * Set description for each values |
||
| 29 | * |
||
| 30 | * @var array |
||
| 31 | */ |
||
| 32 | protected static $descriptions = []; |
||
| 33 | |||
| 34 | /** |
||
| 35 | * If the public name should |
||
| 36 | * be different to the internal one |
||
| 37 | * |
||
| 38 | * @var array |
||
| 39 | */ |
||
| 40 | protected static $publicNames = []; |
||
| 41 | |||
| 42 | /** |
||
| 43 | * @param string $type |
||
| 44 | * |
||
| 45 | * @return null|string |
||
| 46 | */ |
||
| 47 | 1 | public static function getDeprecatedReason($type): ?string |
|
| 48 | { |
||
| 49 | 1 | return static::$deprecatedReasons[$type] ?? null; |
|
| 50 | } |
||
| 51 | |||
| 52 | /** |
||
| 53 | * @param string $type |
||
| 54 | * |
||
| 55 | * @return null|string |
||
| 56 | */ |
||
| 57 | 1 | public static function getDescription($type): ?string |
|
| 58 | { |
||
| 59 | 1 | return static::$descriptions[$type] ?? null; |
|
| 60 | } |
||
| 61 | |||
| 62 | /** |
||
| 63 | * @param string $type |
||
| 64 | * |
||
| 65 | * @return mixed |
||
| 66 | */ |
||
| 67 | 1 | public static function getPublicName($type) |
|
| 70 | } |
||
| 71 | } |
||
| 72 |