Conditions | 4 |
Paths | 3 |
Total Lines | 9 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
90 | protected function validateUrl($url) |
||
91 | { |
||
92 | if (!(substr($url, 0, 7) === 'http://' || substr($url, 0, 8) === 'https://')) { |
||
93 | throw new \InvalidArgumentException('The URL must start with "http://" or "https://"'); |
||
94 | } |
||
95 | if (substr($url, -1) !== '/') { |
||
96 | throw new \InvalidArgumentException('The URL must end in a slash (/)'); |
||
97 | } |
||
98 | } |
||
99 | } |
||
100 |