| @@ 67-72 (lines=6) @@ | ||
| 64 | )); |
|
| 65 | } |
|
| 66 | ||
| 67 | if (!ctype_alpha($parts[0][0])) { |
|
| 68 | throw new InvalidUriException(sprintf( |
|
| 69 | 'The URI "%s" is invalid. The scheme should start with a letter.', |
|
| 70 | $uri |
|
| 71 | )); |
|
| 72 | } |
|
| 73 | } else { |
|
| 74 | $parts = array('', $uri); |
|
| 75 | } |
|
| @@ 84-90 (lines=7) @@ | ||
| 81 | )); |
|
| 82 | } |
|
| 83 | ||
| 84 | if ('/' !== $parts[1][0]) { |
|
| 85 | throw new InvalidUriException(sprintf( |
|
| 86 | 'The URI "%s" is invalid. The path should start with a '. |
|
| 87 | 'forward slash ("/").', |
|
| 88 | $uri |
|
| 89 | )); |
|
| 90 | } |
|
| 91 | ||
| 92 | return array( |
|
| 93 | 'scheme' => $parts[0], |
|