TypeRef
A type, kept as a tree rather than a string so each part can be linked independently.
list<Quiote\Routing\Route>|null has to render with Route pointing at its own page while list and null stay plain, which a flat string cannot express. Every node carries a display form so a renderer that does not care about linking can ignore the structure entirely.
Synopsis
Section titled “Synopsis”final class TypeRef implements Stringable
| Implements | Stringable |
| Source | Ir/TypeRef.php |
Constants
Section titled “Constants”| Constant | Value | Description |
|---|---|---|
KIND_GENERIC | 'generic' | |
KIND_INTERSECTION | 'intersection' | |
KIND_LITERAL | 'literal' | |
KIND_NAMED | 'named' | |
KIND_NULLABLE | 'nullable' | |
KIND_UNION | 'union' |
Properties
Section titled “Properties”| Property | Type | Description |
|---|---|---|
$args | array | readonly. |
$display | string | readonly. |
$fqcn | ?``string | readonly. |
$kind | string | readonly. |
Methods
Section titled “Methods”| Method | Description |
|---|---|
__toString(): string | |
generic(TypeRef $base, list<TypeRef> $arguments): TypeRef | |
intersection(list<TypeRef> $members): TypeRef | |
literal(string $text): TypeRef | A keyword, scalar or anything else with no class behind it to link to. |
named(string $fqcn): TypeRef | A class-like type, which may or may not be one the reference documents. |
nullable(TypeRef $inner): TypeRef | |
referencedClasses(): list<string> | Every named type anywhere in the tree, so a renderer can decide what to link without walking the structure itself. |
union(list<TypeRef> $members): TypeRef |
__toString()
Section titled “__toString()”public function __toString(): string
Returns string
generic()
Section titled “generic()”public static function generic(TypeRef $base, list<TypeRef> $arguments): TypeRef
| Parameter | Type | Description |
|---|---|---|
$base | TypeRef | |
$arguments | list``<TypeRef> |
Returns TypeRef
intersection()
Section titled “intersection()”public static function intersection(list<TypeRef> $members): TypeRef
| Parameter | Type | Description |
|---|---|---|
$members | list``<TypeRef> |
Returns TypeRef
literal()
Section titled “literal()”public static function literal(string $text): TypeRef
A keyword, scalar or anything else with no class behind it to link to.
| Parameter | Type | Description |
|---|---|---|
$text | string |
Returns TypeRef
named()
Section titled “named()”public static function named(string $fqcn): TypeRef
A class-like type, which may or may not be one the reference documents.
| Parameter | Type | Description |
|---|---|---|
$fqcn | string |
Returns TypeRef
nullable()
Section titled “nullable()”public static function nullable(TypeRef $inner): TypeRef
| Parameter | Type | Description |
|---|---|---|
$inner | TypeRef |
Returns TypeRef
referencedClasses()
Section titled “referencedClasses()”public function referencedClasses(): list<string>
Every named type anywhere in the tree, so a renderer can decide what to link without walking the structure itself.
Returns list``<``string``>
union()
Section titled “union()”public static function union(list<TypeRef> $members): TypeRef
| Parameter | Type | Description |
|---|---|---|
$members | list``<TypeRef> |
Returns TypeRef