Conditions | 3 |
Paths | 3 |
Total Lines | 10 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
59 | 48 | public function toPsrUri($uri) |
|
60 | { |
||
61 | 48 | if ($uri instanceof UriInterface) { |
|
62 | 15 | return $uri; |
|
63 | 48 | } elseif (is_string($uri)) { |
|
64 | 47 | return new Uri($uri); |
|
65 | } |
||
66 | |||
67 | 1 | throw new InvalidArgumentException('URI must be a string or an instance of \Psr\Http\Message\UriInterface.'); |
|
68 | } |
||
69 | } |
||
70 |