Skip to content
This repository was archived by the owner on Nov 26, 2022. It is now read-only.

Commit c40cec8

Browse files
committed
bugfix test suite
1 parent 842d98f commit c40cec8

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

README.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,10 +133,19 @@ Just like with `QueryString::parse`, you can specify the separator and the encod
133133

134134
### Extracting PHP variables
135135

136-
`QueryString::parse` and `QueryString::build` preserve the query string pairs content and order. If you want to extract PHP variables from the query string *à la* `parse_str` you can use `QueryString::extract`. The public static method:
136+
```php
137+
<?php
138+
139+
public static function QueryString::extract($query, string $separator = '&', int $enc_type = PHP_QUERY_RFC3986): array;
140+
public static function QueryString::convert(iterable $pairs): array;
141+
```
142+
143+
`QueryString::parse` and `QueryString::build` preserve the query string pairs content and order. If you want to extract PHP variables from the query string *à la* `parse_str` you can use:
144+
145+
- The `QueryString::extract` method which takes the same parameters as `League\Uri\QueryString::parse`
146+
- The `QueryString::convert` method which takes the result of `League\Uri\QueryString::parse`
137147

138-
- takes the same parameters as `League\Uri\QueryString::parse`
139-
- does not allow parameters key mangling in the returned array;
148+
both methods, however, do not allow parameters key mangling in the returned array like `parse_str`;
140149

141150
```php
142151
<?php

tests/QueryStringTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
use const PHP_QUERY_RFC1738;
2626
use const PHP_QUERY_RFC3986;
2727

28-
class FunctionsTest extends TestCase
28+
class QueryStringTest extends TestCase
2929
{
3030
public function testEncodingThrowsExceptionWithQueryParser(): void
3131
{

0 commit comments

Comments
 (0)