1 | <?php declare(strict_types=1); |
||
11 | final class Types |
||
12 | { |
||
13 | protected static $types = []; |
||
14 | |||
15 | /** |
||
16 | * @var bool |
||
17 | */ |
||
18 | protected static $doneScanning = false; |
||
19 | |||
20 | /** |
||
21 | * @return Generator<Type> |
||
|
|||
22 | */ |
||
23 | 4 | public static function types(): Generator |
|
51 | |||
52 | /** |
||
53 | * @param string $type |
||
54 | * @return bool |
||
55 | */ |
||
56 | 2 | public static function has(string $type): bool |
|
62 | |||
63 | /** |
||
64 | * @param string $type |
||
65 | * @throws Exception |
||
66 | * @return Type |
||
67 | */ |
||
68 | 2 | public static function get(string $type): Type |
|
78 | |||
79 | /** |
||
80 | * Reset state. |
||
81 | */ |
||
82 | 1 | public static function reset() |
|
87 | |||
88 | /** |
||
89 | * A wee bit hacky, but this ensures that when ever `has` or `get` is called before `types` |
||
90 | * all types are detected and available for `has` and `get`. |
||
91 | */ |
||
92 | 4 | protected static function ensureTypes() |
|
101 | } |
||
102 |
This check marks PHPDoc comments that could not be parsed by our parser. To see which comment annotations we can parse, please refer to our documentation on supported doc-types.