1 | <?php declare(strict_types=1); |
||
11 | 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 | public static function types(): Generator |
||
50 | |||
51 | /** |
||
52 | * @param string $type |
||
53 | * @return bool |
||
54 | */ |
||
55 | public static function has(string $type): bool |
||
61 | |||
62 | /** |
||
63 | * @param string $type |
||
64 | * @return Type |
||
65 | * @throws Exception |
||
66 | */ |
||
67 | public static function get(string $type): Type |
||
77 | |||
78 | /** |
||
79 | * A wee bit hacky, but this ensures that when ever `has` or `get` is called before `types` |
||
80 | * all types are detected and available for `has` and `get`. |
||
81 | */ |
||
82 | protected function ensureTypes() |
||
91 | |||
92 | public static function reset() |
||
97 | } |
||
98 |
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.