1 | <?php |
||
15 | class Type implements TypeInterface, \JsonSerializable |
||
16 | { |
||
17 | /** |
||
18 | * @var TypeNameInterface |
||
19 | */ |
||
20 | private $type; |
||
21 | |||
22 | /** |
||
23 | * @var array |
||
24 | */ |
||
25 | private static $inheritance = []; |
||
26 | |||
27 | /** |
||
28 | * @var array|string[] |
||
29 | */ |
||
30 | private $parent; |
||
31 | |||
32 | /** |
||
33 | * Type constructor. |
||
34 | * @param TypeNameInterface $type |
||
35 | */ |
||
36 | private function __construct(TypeNameInterface $type) |
||
41 | |||
42 | /** |
||
43 | * @param string $name |
||
44 | * @return array |
||
45 | */ |
||
46 | private function getInheritanceSequence(string $name): array |
||
54 | |||
55 | /** |
||
56 | * @param \SplStack $stack |
||
57 | * @param array $children |
||
58 | */ |
||
59 | private function bootInheritance(\SplStack $stack, array $children = []): void |
||
83 | |||
84 | /** |
||
85 | * @param TypeNameInterface $name |
||
86 | * @return TypeInterface |
||
87 | */ |
||
88 | public static function of(TypeNameInterface $name): TypeInterface |
||
92 | |||
93 | /** |
||
94 | * @return TypeNameInterface |
||
95 | */ |
||
96 | public function getName(): TypeNameInterface |
||
100 | |||
101 | /** |
||
102 | * {@inheritDoc} |
||
103 | */ |
||
104 | public function is(TypeInterface $type): bool |
||
108 | |||
109 | /** |
||
110 | * {@inheritDoc} |
||
111 | */ |
||
112 | public function instanceOf(TypeInterface $type): bool |
||
118 | |||
119 | /** |
||
120 | * @return string |
||
121 | */ |
||
122 | public function jsonSerialize(): string |
||
126 | } |
||
127 |