Total Complexity | 5 |
Total Lines | 45 |
Duplicated Lines | 0 % |
Coverage | 87.5% |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
8 | abstract class AbstractLeniency |
||
9 | { |
||
10 | /** |
||
11 | * Integer level to compare 'ENUMs' |
||
12 | * @var int |
||
13 | */ |
||
14 | protected static $level; |
||
15 | |||
16 | /** |
||
17 | * Returns true if $number is a verified number according to this leniency |
||
18 | * |
||
19 | * @param PhoneNumber $number |
||
20 | * @param string $candidate |
||
21 | * @param PhoneNumberUtil $util |
||
22 | * @return bool |
||
23 | * @codeCoverageIgnore |
||
24 | */ |
||
25 | public static function verify(PhoneNumber $number, $candidate, PhoneNumberUtil $util) |
||
26 | { |
||
27 | // This can not be called directly |
||
28 | throw new \BadMethodCallException; |
||
29 | } |
||
30 | |||
31 | /** |
||
32 | * Compare against another Leniency |
||
33 | * @param AbstractLeniency $leniency |
||
34 | * @return int |
||
35 | */ |
||
36 | 180 | public static function compareTo(AbstractLeniency $leniency) |
|
39 | } |
||
40 | |||
41 | 180 | protected static function getLevel() |
|
42 | { |
||
43 | 180 | if (static::$level === null) { |
|
44 | throw new \RuntimeException('$level should be defined'); |
||
45 | } |
||
46 | |||
47 | 180 | return static::$level; |
|
48 | } |
||
49 | |||
50 | 172 | public function __toString() |
|
53 | } |
||
54 | } |
||
55 |
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.