| Conditions | 3 |
| Paths | 2 |
| Total Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 33 | public function resolve(string $resource_name): Identifier |
||
| 34 | { |
||
| 35 | $uri = parse($resource_name); |
||
| 36 | if (!\is_string($uri['path']) || !\is_string($uri['host'])) { |
||
| 37 | throw new \InvalidArgumentException('Invalid resource.'); |
||
| 38 | } |
||
| 39 | |||
| 40 | return new Identifier(\mb_substr($uri['path'], 2), $uri['host'], $uri['port']); |
||
| 41 | } |
||
| 42 | } |
||
| 43 |