Conditions | 4 |
Paths | 4 |
Total Lines | 20 |
Code Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
17 | public static function isValid($number, $type = 'identity') |
||
18 | { |
||
19 | switch ($type) { |
||
20 | case 'identity': |
||
21 | $validator = new IdentityNumber(); |
||
22 | return $validator->isValid($number); |
||
23 | break; |
||
|
|||
24 | |||
25 | case 'organization': |
||
26 | $validator = new OrganizationNumber(); |
||
27 | return $validator->isValid($number); |
||
28 | break; |
||
29 | |||
30 | case 'coordination': |
||
31 | $validator = new CoordinationNumber(); |
||
32 | return $validator->isValid($number); |
||
33 | break; |
||
34 | } |
||
35 | |||
36 | return false; |
||
37 | } |
||
39 |
The
break
statement is not necessary if it is preceded for example by areturn
statement:If you would like to keep this construct to be consistent with other
case
statements, you can safely mark this issue as a false-positive.