Skip to content

Commit

Permalink
Improve UserInfo instantiation
Browse files Browse the repository at this point in the history
  • Loading branch information
nyamsprod committed Feb 15, 2016
1 parent 2e00cee commit 3c3ce96
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/Schemes/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@
use League\Uri\Components\DataPath as Path;
use League\Uri\Components\Fragment;
use League\Uri\Components\Host;
use League\Uri\Components\Pass;
use League\Uri\Components\Port;
use League\Uri\Components\Query;
use League\Uri\Components\Scheme;
use League\Uri\Components\User;
use League\Uri\Components\UserInfo;
use League\Uri\Interfaces\DataPath as PathInterface;
use League\Uri\Interfaces\Fragment as FragmentInterface;
Expand Down Expand Up @@ -115,7 +117,7 @@ public static function createFromComponents(array $components)

return new static(
new Scheme($components['scheme']),
new UserInfo($components['user'], $components['pass']),
new UserInfo(new User($components['user']), new Pass($components['pass'])),
new Host($components['host']),
new Port($components['port']),
new Path($components['path']),
Expand Down
4 changes: 3 additions & 1 deletion src/Schemes/Generic/AbstractHierarchicalUri.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@
use League\Uri\Components\Fragment;
use League\Uri\Components\HierarchicalPath as Path;
use League\Uri\Components\Host;
use League\Uri\Components\Pass;
use League\Uri\Components\Port;
use League\Uri\Components\Query;
use League\Uri\Components\Scheme;
use League\Uri\Components\User;
use League\Uri\Components\UserInfo;
use League\Uri\Interfaces\Fragment as FragmentInterface;
use League\Uri\Interfaces\HierarchicalPath as PathInterface;
Expand Down Expand Up @@ -99,7 +101,7 @@ public static function createFromComponents(array $components)

return new static(
new Scheme($components['scheme']),
new UserInfo($components['user'], $components['pass']),
new UserInfo(new User($components['user']), new Pass($components['pass'])),
new Host($components['host']),
new Port($components['port']),
new Path($components['path']),
Expand Down

0 comments on commit 3c3ce96

Please sign in to comment.