File tree 1 file changed +11
-0
lines changed
1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -177,6 +177,7 @@ $newQuery->__toString(); //return baz=toto&foo=bar&foo=toto
177
177
public static Query::fromVariable($params, string $separator = '& '): self
178
178
public Query::parameters(): array
179
179
public Query::parameter(string $name): mixed
180
+ public Query::hasParameter(string ...$name): bool
180
181
public Query::withoutNumericIndices(): self
181
182
public Query::withoutParameter(...string $offsets): self
182
183
~~~
@@ -227,6 +228,16 @@ $query->parameter('gweta'); //return null
227
228
228
229
The method returns the value of a specific argument. If the argument does not exist it will return ` null ` .
229
230
231
+ The class can tell whether a parameter or a range of parameters are present using the ` Query::hasParameter ` method.
232
+ The method will take a variadic number of parameter names and will return ` true ` only if all the names are
233
+ present in the query parameter bag.
234
+
235
+ ~~~ php
236
+ $query = Query::fromRFC3986('foo[]=bar&foo[]=y+olo&z=');
237
+ $query->hasParameter('gweta'); //return false
238
+ $query->hasParameter('foo', 'z'); //return true
239
+ $query->hasParameter('foo', 'gweta'); //return false
240
+ ~~~
230
241
231
242
### Query::withoutParameter
232
243
You can’t perform that action at this time.
0 commit comments