1 | <?php |
||
16 | class TypeMap |
||
17 | { |
||
18 | |||
19 | const KIND_SCALAR = 'SCALAR'; |
||
20 | const KIND_OBJECT = 'OBJECT'; |
||
21 | const KIND_LIST = 'LIST'; |
||
22 | const KIND_ENUM = 'ENUM'; |
||
23 | const KIND_UNION = 'UNION'; |
||
24 | |||
25 | const TYPE_INT = 'int'; |
||
26 | const TYPE_FLOAT = 'float'; |
||
27 | const TYPE_STRING = 'string'; |
||
28 | const TYPE_BOOLEAN = 'boolean'; |
||
29 | const TYPE_ID = 'id'; |
||
30 | |||
31 | const TYPE_FUNCTION = 'function'; |
||
32 | const TYPE_OBJECT_TYPE = 'object_type'; |
||
33 | const TYPE_OBJECT_INPUT_TYPE = 'object_input_type'; |
||
34 | const TYPE_LIST = 'list'; |
||
35 | const TYPE_ARRAY = 'array'; |
||
36 | const TYPE_ARRAY_OF_FIELDS = 'array_of_fields'; |
||
37 | const TYPE_ARRAY_OF_INPUTS = 'array_of_inputs'; |
||
38 | const TYPE_ANY = 'any'; |
||
39 | const TYPE_ANY_OBJECT = 'any_object'; |
||
40 | const TYPE_ANY_INPUT = 'any_input'; |
||
41 | |||
42 | private static $scalarObjectsCache = []; |
||
43 | |||
44 | 3 | public static function isInputType($type) |
|
52 | |||
53 | /** |
||
54 | * @param string $type |
||
55 | * |
||
56 | * @return ObjectType |
||
57 | */ |
||
58 | 8 | public static function getScalarTypeObject($type) |
|
71 | |||
72 | 8 | public static function isScalarType($typeName) |
|
76 | |||
77 | 4 | /** |
|
78 | * @return AbstractType[] |
||
79 | 4 | */ |
|
80 | public static function getScalarTypes() |
||
86 | |||
87 | } |