|
@@ 30-32 (lines=3) @@
|
| 27 |
|
public static function parseUrl($url) { |
| 28 |
|
$parts = parse_url ( $url ); |
| 29 |
|
|
| 30 |
|
if (false === $parts || false === Arrays::hasElement ( $parts, 'host' )) { |
| 31 |
|
throw new InvalidUrlException ( 'This URL does not contain a host part' ); |
| 32 |
|
} |
| 33 |
|
if (false === $parts || false === Arrays::hasElement ( $parts, 'scheme' )) { |
| 34 |
|
throw new InvalidUrlException ( 'This URL does not contain a scheme part' ); |
| 35 |
|
} |
|
@@ 33-35 (lines=3) @@
|
| 30 |
|
if (false === $parts || false === Arrays::hasElement ( $parts, 'host' )) { |
| 31 |
|
throw new InvalidUrlException ( 'This URL does not contain a host part' ); |
| 32 |
|
} |
| 33 |
|
if (false === $parts || false === Arrays::hasElement ( $parts, 'scheme' )) { |
| 34 |
|
throw new InvalidUrlException ( 'This URL does not contain a scheme part' ); |
| 35 |
|
} |
| 36 |
|
|
| 37 |
|
$address = $parts ['host']; |
| 38 |
|
$scheme = $parts ['scheme']; |