1 | <?php |
||
26 | class Query implements QueryInterface |
||
27 | { |
||
28 | use ImmutableComponentTrait; |
||
29 | |||
30 | use ImmutableCollectionTrait; |
||
31 | |||
32 | /** |
||
33 | * Key/pair separator character |
||
34 | * |
||
35 | * @var string |
||
36 | */ |
||
37 | protected static $separator = '&'; |
||
38 | |||
39 | /** |
||
40 | * Preserve the delimiter |
||
41 | * |
||
42 | * @var bool |
||
43 | */ |
||
44 | protected $preserveDelimiter = false; |
||
45 | |||
46 | /** |
||
47 | * DEPRECATION WARNING! This method will be removed in the next major point release |
||
48 | * |
||
49 | * @deprecated deprecated since version 4.2 |
||
50 | * |
||
51 | * return a new instance from an array or a traversable object |
||
52 | * |
||
53 | * @param \Traversable|array $data |
||
54 | * |
||
55 | * @return static |
||
56 | */ |
||
57 | public static function createFromArray($data) |
||
61 | |||
62 | /** |
||
63 | * return a new Query instance from an Array or a traversable object |
||
64 | * |
||
65 | * @param \Traversable|array $data |
||
66 | * |
||
67 | * @return static |
||
68 | */ |
||
69 | 108 | public static function createFromPairs($data) |
|
79 | |||
80 | /** |
||
81 | * a new instance |
||
82 | * |
||
83 | * @param string $data |
||
84 | */ |
||
85 | 898 | public function __construct($data = null) |
|
90 | |||
91 | /** |
||
92 | * sanitize the submitted data |
||
93 | * |
||
94 | * @param string $str |
||
95 | * |
||
96 | * @return array |
||
97 | */ |
||
98 | 898 | protected function validate($str) |
|
107 | |||
108 | /** |
||
109 | * @inheritdoc |
||
110 | */ |
||
111 | 2 | public function __debugInfo() |
|
115 | |||
116 | /** |
||
117 | * @inheritdoc |
||
118 | */ |
||
119 | 12 | public static function __set_state(array $properties) |
|
126 | |||
127 | /** |
||
128 | * Returns the component literal value. |
||
129 | * |
||
130 | * @return null|string |
||
131 | */ |
||
132 | 805 | public function getContent() |
|
140 | |||
141 | /** |
||
142 | * Returns the instance string representation; If the |
||
143 | * instance is not defined an empty string is returned |
||
144 | * |
||
145 | * @return string |
||
146 | */ |
||
147 | 793 | public function __toString() |
|
151 | |||
152 | /** |
||
153 | * Returns the instance string representation |
||
154 | * with its optional URI delimiters |
||
155 | * |
||
156 | * @return string |
||
157 | */ |
||
158 | 758 | public function getUriComponent() |
|
167 | |||
168 | /** |
||
169 | * Returns an instance with the specified string |
||
170 | * |
||
171 | * This method MUST retain the state of the current instance, and return |
||
172 | * an instance that contains the modified data |
||
173 | * |
||
174 | * @param string $value |
||
175 | * |
||
176 | * @return static |
||
177 | */ |
||
178 | 198 | public function modify($value) |
|
186 | |||
187 | /** |
||
188 | * Retrieves a single query parameter. |
||
189 | * |
||
190 | * Retrieves a single query parameter. If the parameter has not been set, |
||
191 | * returns the default value provided. |
||
192 | * |
||
193 | * @param string $offset the parameter name |
||
194 | * @param mixed $default Default value to return if the parameter does not exist. |
||
195 | * |
||
196 | * @return mixed |
||
197 | */ |
||
198 | 9 | public function getValue($offset, $default = null) |
|
206 | |||
207 | /** |
||
208 | * Returns an instance merge with the specified query |
||
209 | * |
||
210 | * This method MUST retain the state of the current instance, and return |
||
211 | * an instance that contains the modified query |
||
212 | * |
||
213 | * @param Query|string $query the data to be merged query can be |
||
214 | * - another Interfaces\Query object |
||
215 | * - a string or a Stringable object |
||
216 | * |
||
217 | * @return static |
||
218 | */ |
||
219 | 24 | public function merge($query) |
|
231 | |||
232 | /** |
||
233 | * Sort the query string by offset, maintaining offset to data correlations. |
||
234 | * |
||
235 | * This method MUST retain the state of the current instance, and return |
||
236 | * an instance that contains the modified query |
||
237 | * |
||
238 | * @param callable|int $sort a PHP sort flag constant or a comparaison function |
||
239 | * which must return an integer less than, equal to, |
||
240 | * or greater than zero if the first argument is |
||
241 | * considered to be respectively less than, equal to, |
||
242 | * or greater than the second. |
||
243 | * |
||
244 | * @return static |
||
245 | */ |
||
246 | 45 | public function ksort($sort = SORT_REGULAR) |
|
257 | |||
258 | /** |
||
259 | * Return a new instance when needed |
||
260 | * |
||
261 | * @param array $data |
||
262 | * |
||
263 | * @return static |
||
264 | */ |
||
265 | 42 | protected function newCollectionInstance(array $data) |
|
273 | } |
||
274 |
This method has been deprecated. The supplier of the class has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the method will be removed from the class and what other method or class to use instead.