| Total Complexity | 7 |
| Total Lines | 44 |
| Duplicated Lines | 0 % |
| Coverage | 93.33% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 20 | final class ValueTypeCasting |
||
| 21 | { |
||
| 22 | |||
| 23 | private const DEFINABLE_TYPES_MAP = [ |
||
| 24 | IntType::class, |
||
| 25 | FloatType::class, |
||
| 26 | TrueType::class, |
||
| 27 | FalseType::class, |
||
| 28 | NullType::class, |
||
| 29 | BoolType::class, |
||
| 30 | StringType::class, |
||
| 31 | Int8Type::class, |
||
| 32 | Int16Type::class |
||
| 33 | ]; |
||
| 34 | |||
| 35 | private float|bool|int|string|null $castedValue; |
||
| 36 | |||
| 37 | 34 | public function __construct(private string $originalValue) |
|
| 41 | } |
||
| 42 | |||
| 43 | 12 | public static function castType(string|bool|int|float|null $value): string|bool|int|float|null |
|
| 49 | } |
||
| 50 | |||
| 51 | 34 | public function getCastValue(): float|bool|int|string|null |
|
| 52 | { |
||
| 53 | 34 | return $this->castedValue; |
|
| 54 | } |
||
| 55 | |||
| 56 | 34 | private function determine(): void |
|
| 64 | } |
||
| 65 | } |
||
| 71 |