| Conditions | 2 |
| Paths | 2 |
| Total Lines | 9 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 14 | public function convertToPHPValue( mixed $value, AbstractPlatform $platform ): DomainAddressType { |
||
| 15 | if ( !is_string( $value ) ) { |
||
| 16 | throw new \LogicException( 'Value from database has to be of type string' ); |
||
| 17 | } |
||
| 18 | return match ( $value ) { |
||
| 19 | 'person' => DomainAddressType::Person, |
||
| 20 | 'company' => DomainAddressType::Company, |
||
| 21 | default => throw new \InvalidArgumentException( |
||
| 22 | "Could not convert address type string ({$value}) to enum" |
||
| 23 | ), |
||
| 46 |