Skip to content

Commit 8be8c54

Browse files
committed
Add missing documentation for Query::hasParameter
1 parent a7ff903 commit 8be8c54

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

docs/components/7.0/query.md

+11
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@ $newQuery->__toString(); //return baz=toto&foo=bar&foo=toto
177177
public static Query::fromVariable($params, string $separator = '&'): self
178178
public Query::parameters(): array
179179
public Query::parameter(string $name): mixed
180+
public Query::hasParameter(string ...$name): bool
180181
public Query::withoutNumericIndices(): self
181182
public Query::withoutParameter(...string $offsets): self
182183
~~~
@@ -227,6 +228,16 @@ $query->parameter('gweta'); //return null
227228

228229
The method returns the value of a specific argument. If the argument does not exist it will return `null`.
229230

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+
~~~
230241

231242
### Query::withoutParameter
232243

0 commit comments

Comments
 (0)