Skip to content

Commit

Permalink
bug fix v5 doc
Browse files Browse the repository at this point in the history
  • Loading branch information
nyamsprod committed Jan 31, 2017
1 parent 50de1b8 commit ba71674
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 9 deletions.
6 changes: 3 additions & 3 deletions docs/5.0/manipulations/middlewares.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ $query_to_merge = 'fo.o=bar&taz=';

$uri = SlimUri::createFromString($base_uri);
$source_query = $uri->getQuery();
parse_str($source_query, $pairs);
parse_str($query_to_merge, $new_pairs);
parse_str($source_query, $params);
parse_str($query_to_merge, $new_params);
$new_query = http_build_query(
array_merge($pairs, $new_pairs),
array_merge($params, $new_params),
'',
'&',
PHP_QUERY_RFC3986
Expand Down
4 changes: 2 additions & 2 deletions docs/5.0/manipulations/references.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ An associative array is returned. The following keys are always present within t
<?php

use GuzzleHttp\Psr7\Uri as GuzzleUri;
use League\Uri\Schemes\Http as HttpUri;
use League\Uri\Schemes\Http;
use function League\Uri\Modifiers\uri_reference;

$guzzle_uri = new GuzzleUri("//스타벅스코리아.com/how/are/you?foo=baz");
$alt_uri = HttpUri::createFromString("//xn--oy2b35ckwhba574atvuzkc.com/how/are/you?foo=baz#bar");
$alt_uri = Http::createFromString("//xn--oy2b35ckwhba574atvuzkc.com/how/are/you?foo=baz#bar");

var_dump(uri_reference($guzzle_uri));
//displays
Expand Down
4 changes: 2 additions & 2 deletions docs/5.0/uri/extension.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,11 +135,11 @@ class Mailto extends AbstractUri
* A specific named constructor to speed up
* creating a new instance from a collection of mails
*
* @param \Traversable|string[] $emails
* @param string[] $emails
*
* @return static
*/
public static function createFromEmails($emails)
public static function createFromEmails(array $emails)
{
$verif = filter_var($emails, FILTER_VALIDATE_EMAIL, FILTER_REQUIRE_ARRAY);
if ($emails !== $verif) {
Expand Down
3 changes: 2 additions & 1 deletion docs/5.0/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ $uri = new GuzzleUri("http://www.example.com/report");
//we register and apply the common transformations
$modifiers = (new Pipeline())
->pipe(new AppendSegment('/purchases/summary'))
->pipe(new ReplaceLabel(3, 'download'));
->pipe(new ReplaceLabel(-1, 'download'));
$tmpUri = $modifiers->process($uri->withScheme('https'));

//the specific transformation are applied here
Expand All @@ -79,4 +79,5 @@ echo $uri, PHP_EOL; // display "http://www.example.com/report"
echo $links['csv'], PHP_EOL; // display "https://download.example.com/report/purchases/summary.csv"
echo $links['xml'], PHP_EOL; // display "https://download.example.com/report/purchases/summary.xml"
echo $links['json'], PHP_EOL; // display "https://download.example.com/report/purchases/summary.json"
echo get_class($links['json']), PHP_EOL; // display "GuzzleHttp\Psr7\Uri"
~~~
2 changes: 1 addition & 1 deletion docs/upgrading/upgrading-5.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ After:
use League\Uri\Components\Host;

$host = new Host('::1'); //triggers an Exception
$host = Host::createFromIp('::1')->__toString(); //display '[::1]'
echo Host::createFromIp('::1'); //display '[::1]'
~~~


Expand Down

0 comments on commit ba71674

Please sign in to comment.