| Conditions | 3 |
| Paths | 3 |
| Total Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 9 | public static function fromString(string $string): Color |
||
| 10 | { |
||
| 11 | $colorClasses = static::getColorClasses(); |
||
| 12 | |||
| 13 | foreach ($colorClasses as $colorClass) { |
||
| 14 | try { |
||
| 15 | return $colorClass::fromString($string); |
||
| 16 | } catch (InvalidColorValue $e) { |
||
| 17 | // Catch the exception but never throw it. |
||
| 18 | } |
||
| 19 | } |
||
| 20 | |||
| 21 | throw InvalidColorValue::malformedColorString($string); |
||
| 22 | } |
||
| 23 | |||
| 35 |