Total Complexity | 4 |
Total Lines | 53 |
Duplicated Lines | 0 % |
Coverage | 0% |
Changes | 0 |
1 | <?php |
||
15 | class DynamicObjectType extends ScalarType |
||
16 | { |
||
17 | public const DYNAMIC_OBJECT = 'DynamicObject'; |
||
18 | /** |
||
19 | * {@inheritdoc} |
||
20 | */ |
||
21 | public function __construct() |
||
22 | { |
||
23 | $this->name = self::DYNAMIC_OBJECT; |
||
24 | $this->description = 'The `DynamicObject` represent a object with unknown and dynamic properties. |
||
25 | For this type of objects you can\'t select the properties to get. |
||
26 | |||
27 | A common usage of these type of objects is when the object represent a set of **key:value** pairs'; |
||
28 | |||
29 | parent::__construct([]); |
||
30 | } |
||
31 | |||
32 | /** |
||
33 | * Serializes an internal value to include in a response. |
||
34 | * |
||
35 | * @param string $value |
||
36 | * |
||
37 | * @return string |
||
38 | */ |
||
39 | public function serialize($value) |
||
42 | } |
||
43 | |||
44 | /** |
||
45 | * Parses an externally provided value (query variable) to use as an input |
||
46 | * |
||
47 | * @param mixed $value |
||
48 | * |
||
49 | * @return mixed |
||
50 | * |
||
51 | * @throws \Error |
||
52 | */ |
||
53 | public function parseValue($value) |
||
54 | { |
||
55 | return $value; |
||
56 | } |
||
57 | |||
58 | /** |
||
59 | * @param \GraphQL\Language\AST\Node $valueNode |
||
60 | * |
||
61 | * @return string |
||
62 | * |
||
63 | * @throws \Error |
||
64 | */ |
||
65 | public function parseLiteral($valueNode) |
||
68 | } |
||
69 | } |