Conditions | 3 |
Paths | 3 |
Total Lines | 13 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 3 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
29 | 823 | protected function validate($scheme) |
|
30 | { |
||
31 | 823 | if (null === $scheme) { |
|
32 | 324 | return $scheme; |
|
33 | } |
||
34 | |||
35 | 736 | $scheme = $this->validateString($scheme); |
|
36 | 724 | if (!preg_match(',^[a-z]([-a-z0-9+.]+)?$,i', $scheme)) { |
|
37 | 9 | throw new InvalidArgumentException(sprintf("Invalid Submitted scheme: '%s'", $scheme)); |
|
38 | } |
||
39 | |||
40 | 715 | return strtolower($scheme); |
|
41 | } |
||
42 | |||
67 |