| Total Complexity | 4 |
| Total Lines | 24 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 10 | class ImageProcessorName |
||
| 11 | { |
||
| 12 | /** @var string[] */ |
||
| 13 | private static $names = ['neato', 'dot']; |
||
| 14 | |||
| 15 | /** @var string */ |
||
| 16 | private $name; |
||
| 17 | |||
| 18 | 30 | public static function from(?string $text): ImageProcessorName |
|
| 19 | { |
||
| 20 | 30 | return new ImageProcessorName($text); |
|
| 21 | } |
||
| 22 | |||
| 23 | 24 | public function is(string $name): bool |
|
| 24 | { |
||
| 25 | 24 | return $this->name === $name; |
|
| 26 | } |
||
| 27 | |||
| 28 | 30 | private function __construct(?string $name) |
|
| 34 | 27 | } |
|
| 35 | } |
||
| 36 |