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 | 778 | protected function validate($scheme) |
|
30 | { |
||
31 | 778 | if (null === $scheme) { |
|
32 | 279 | return $scheme; |
|
33 | } |
||
34 | |||
35 | 730 | $scheme = $this->validateString($scheme); |
|
36 | 718 | if (!preg_match(',^[a-z]([-a-z0-9+.]+)?$,i', $scheme)) { |
|
37 | 9 | throw new InvalidArgumentException(sprintf("Invalid Submitted scheme: '%s'", $scheme)); |
|
38 | } |
||
39 | |||
40 | 709 | return strtolower($scheme); |
|
41 | } |
||
42 | |||
59 |