Lines 100.00% 1 / 1
Functions and Methods 100.00% 1 / 1
Classes and Traits 100.00% 1 / 1
Name Lines Functions and Methods CRAP Classes and Traits
ProbeKind 100.00% 1 / 1 100.00% 1 / 1 1 100.00% 1 / 1
 parse 100.00% 1 / 1 100.00% 1 / 1 1
1<?php
2
3declare(strict_types=1);
4
5namespace Stewart\Runtime\Health;
6
7use Stewart\Runtime\Exception\ConfigurationException;
8
9enum ProbeKind: string
10{
11    case Liveness = 'liveness';
12    case Readiness = 'readiness';
13
14    /** @throws ConfigurationException */
15    public static function parse(string $raw): self
16    {
17        return self::tryFrom($raw) ?? throw ConfigurationException::valueInvalid($raw, 'liveness or readiness');
18    }
19}