1 | <?php |
||
16 | class Classes |
||
17 | { |
||
18 | const INTERNET = 'IN'; |
||
19 | const CSNET = 'CS'; |
||
20 | const CHAOS = 'CH'; |
||
21 | const HESIOD = 'HS'; |
||
22 | |||
23 | /** |
||
24 | * @var array |
||
25 | */ |
||
26 | public static $classes = [ |
||
27 | self::CHAOS => 'CHAOS', |
||
28 | self::CSNET => 'CSNET', |
||
29 | self::HESIOD => 'Hesiod', |
||
30 | self::INTERNET => 'Internet', |
||
31 | ]; |
||
32 | |||
33 | const CLASS_IDS = [ |
||
34 | self::CHAOS => 3, |
||
35 | self::CSNET => 2, |
||
36 | self::HESIOD => 4, |
||
37 | self::INTERNET => 1, |
||
38 | ]; |
||
39 | |||
40 | /** |
||
41 | * Determine if a class is valid. |
||
42 | * |
||
43 | * @param string $class |
||
44 | * |
||
45 | * @return bool |
||
46 | */ |
||
47 | 36 | public static function isValid(string $class): bool |
|
51 | |||
52 | /** |
||
53 | * @param string $className |
||
54 | * |
||
55 | * @return int |
||
56 | * |
||
57 | * @throws \InvalidArgumentException |
||
58 | */ |
||
59 | 2 | public static function getClassId(string $className): int |
|
67 | } |
||
68 |