Conditions | 4 |
Paths | 4 |
Total Lines | 12 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
20 | public static function getInstance($tipo) |
||
21 | { |
||
22 | |||
23 | switch($tipo) |
||
24 | { |
||
25 | case Tipo::MOTOS: return new ConsultaMotoApi(); |
||
26 | case Tipo::CAMINHOES: return new ConsultaMotoApi(); |
||
27 | case Tipo::CARROS: return new ConsultaMotoApi(); |
||
28 | } |
||
29 | |||
30 | throw new \Exception("Tipo {$tipo} não definido"); |
||
31 | } |
||
32 | } |
According to the PSR-2, the body of a case statement must start on the line immediately following the case statement.
}
To learn more about the PSR-2 coding standard, please refer to the PHP-Fig.