Conditions | 3 |
Paths | 2 |
Total Lines | 9 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
41 | public function resolve(string $resource_name): Identifier |
||
42 | { |
||
43 | $uri = parse($resource_name); |
||
44 | if (!is_string($uri['path']) || !is_string($uri['host'])) { |
||
45 | throw new \InvalidArgumentException('Invalid resource.'); |
||
46 | } |
||
47 | |||
48 | return new Identifier(substr($uri['path'], 2), $uri['host'], $uri['port']); |
||
49 | } |
||
50 | } |