1 | <?php |
||
19 | final class IdScalar extends ScalarDefinition |
||
20 | { |
||
21 | /** |
||
22 | * @var string |
||
23 | */ |
||
24 | public const TYPE_NAME = 'ID'; |
||
25 | |||
26 | /** |
||
27 | * @var string |
||
28 | */ |
||
29 | public const TYPE_DESCRIPTION = <<<Description |
||
30 | The ID scalar type represents a unique identifier, often used to refetch |
||
31 | an object or as the key for a cache. The ID type is serialized in the |
||
32 | same way as a String; however, defining it as an ID signifies that it |
||
33 | is not intended to be human‐readable. |
||
34 | Description; |
||
35 | |||
36 | /** |
||
37 | * BooleanScalar constructor. |
||
38 | * @param Document $document |
||
39 | */ |
||
40 | 9 | public function __construct(Document $document) |
|
46 | |||
47 | /** |
||
48 | * @param mixed $value |
||
49 | * @return string |
||
50 | * @throws TypeConflictException |
||
51 | */ |
||
52 | public function parse($value): string |
||
60 | |||
61 | /** |
||
62 | * @param mixed $value |
||
63 | * @return string |
||
64 | * @throws TypeConflictException |
||
65 | */ |
||
66 | public function serialize($value): string |
||
74 | |||
75 | /** |
||
76 | * @return int |
||
77 | */ |
||
78 | public function getLine(): int |
||
82 | |||
83 | /** |
||
84 | * @return bool |
||
85 | */ |
||
86 | public function isBuiltin(): bool |
||
90 | } |
||
91 |