1 | <?php |
||
17 | class StringValueNode extends AbstractAstValueNode |
||
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 | private function getStringValue(): string |
||
39 | |||
40 | /** |
||
41 | * @return string |
||
42 | */ |
||
43 | public function parse(): string |
||
62 | |||
63 | /** |
||
64 | * @param string $value |
||
65 | * @return string |
||
66 | */ |
||
67 | private function encodeSlashes(string $value): string |
||
71 | |||
72 | /** |
||
73 | * Method for parsing and decode utf-8 character |
||
74 | * sequences like "\uXXXX" type. |
||
75 | * |
||
76 | * @see http://facebook.github.io/graphql/October2016/#sec-String-Value |
||
77 | * @param string $body |
||
78 | * @return string |
||
79 | */ |
||
80 | private function renderUtfSequences(string $body): string |
||
94 | |||
95 | /** |
||
96 | * @param string $body |
||
97 | * @return string |
||
98 | */ |
||
99 | private function forwardRenderUtfSequences(string $body): string |
||
103 | |||
104 | /** |
||
105 | * @param string $body |
||
106 | * @return string |
||
107 | */ |
||
108 | private function fallbackRenderUtfSequences(string $body): string |
||
122 | |||
123 | /** |
||
124 | * Method for parsing special control characters. |
||
125 | * |
||
126 | * @see http://facebook.github.io/graphql/October2016/#sec-String-Value |
||
127 | * @param string $body |
||
128 | * @return string |
||
129 | */ |
||
130 | private function renderSpecialCharacters(string $body): string |
||
153 | |||
154 | /** |
||
155 | * @param string $value |
||
156 | * @return string |
||
157 | */ |
||
158 | private function decodeSlashes(string $value): string |
||
162 | } |
||
163 |
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.