Conditions | 3 |
Paths | 3 |
Total Lines | 15 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
23 | public function getEndpoint(string $name, string $version): Endpoint { |
||
24 | switch($version) { |
||
25 | case "1": |
||
26 | switch (strtolower($name)) { |
||
27 | case "phonenumbers": |
||
28 | return new PhoneNumbers($this->geoPhone); |
||
29 | break; |
||
|
|||
30 | default: |
||
31 | throw new UnknownEndpointException("Endpoint: $name not supported"); |
||
32 | } |
||
33 | break; |
||
34 | default: |
||
35 | throw new UnknownEndpointException("Version: $version not support"); |
||
36 | } |
||
37 | } |
||
38 | |||
47 |
The break statement is not necessary if it is preceded for example by a return 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.