| Conditions | 6 |
| Paths | 16 |
| Total Lines | 22 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 19 | public static function create($url, $foundOnUrl = null, int $id = null) |
||
| 20 | { |
||
| 21 | if (! $url instanceof UriInterface) { |
||
| 22 | $url = new Uri($url); |
||
| 23 | } |
||
| 24 | |||
| 25 | if ($url->getScheme() === '') { |
||
| 26 | $url = $url->withScheme('http'); |
||
| 27 | } |
||
| 28 | |||
| 29 | if ($foundOnUrl !== null && ! $foundOnUrl instanceof UriInterface) { |
||
| 30 | $foundOnUrl = new Uri($foundOnUrl); |
||
| 31 | } |
||
| 32 | |||
| 33 | $static = new static($url, $foundOnUrl); |
||
| 34 | |||
| 35 | if ($id !== null) { |
||
| 36 | $static->setId($id); |
||
| 37 | } |
||
| 38 | |||
| 39 | return $static; |
||
| 40 | } |
||
| 41 | |||
| 58 |