1 | <?php |
||
17 | class StringValueNode extends AbstractValueNode |
||
18 | { |
||
19 | /** |
||
20 | * @var string |
||
21 | */ |
||
22 | private const UTF_SEQUENCE_PATTERN = '/(?<!\\\\)\\\\u([0-9a-f]{4})/ui'; |
||
23 | |||
24 | /** |
||
25 | * @var string |
||
26 | */ |
||
27 | private const CHAR_SEQUENCE_PATTERN = '/(?<!\\\\)\\\\(b|f|n|r|t)/u'; |
||
28 | |||
29 | /** |
||
30 | * @return string |
||
31 | */ |
||
32 | public function toPHPString(): string |
||
36 | |||
37 | /** |
||
38 | * @return string |
||
39 | */ |
||
40 | private function getValue(): string |
||
47 | |||
48 | /** |
||
49 | * @return string |
||
50 | */ |
||
51 | public function parse(): string |
||
70 | |||
71 | /** |
||
72 | * @param string $value |
||
73 | * @return string |
||
74 | */ |
||
75 | private function encodeSlashes(string $value): string |
||
79 | |||
80 | /** |
||
81 | * Method for parsing and decode utf-8 character |
||
82 | * sequences like "\uXXXX" type. |
||
83 | * |
||
84 | * @see http://facebook.github.io/graphql/October2016/#sec-String-Value |
||
85 | * @param string $body |
||
86 | * @return string |
||
87 | */ |
||
88 | private function renderUtfSequences(string $body): string |
||
102 | |||
103 | /** |
||
104 | * @param string $body |
||
105 | * @return string |
||
106 | */ |
||
107 | private function forwardRenderUtfSequences(string $body): string |
||
111 | |||
112 | /** |
||
113 | * @param string $body |
||
114 | * @return string |
||
115 | */ |
||
116 | private function fallbackRenderUtfSequences(string $body): string |
||
130 | |||
131 | /** |
||
132 | * Method for parsing special control characters. |
||
133 | * |
||
134 | * @see http://facebook.github.io/graphql/October2016/#sec-String-Value |
||
135 | * @param string $body |
||
136 | * @return string |
||
137 | */ |
||
138 | private function renderSpecialCharacters(string $body): string |
||
161 | |||
162 | /** |
||
163 | * @param string $value |
||
164 | * @return string |
||
165 | */ |
||
166 | private function decodeSlashes(string $value): string |
||
170 | } |
||
171 |
This check marks access to variables or properties that have not been declared yet. While PHP has no explicit notion of declaring a variable, accessing it before a value is assigned to it is most likely a bug.