| Conditions | 4 |
| Paths | 4 |
| Total Lines | 12 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 22 | public static function getInstance($tipo) |
||
| 23 | { |
||
| 24 | |||
| 25 | switch($tipo) |
||
| 26 | { |
||
| 27 | case Tipo::MOTOS: return new ConsultaMotoApi(); |
||
| 28 | case Tipo::CAMINHOES: return new ConsultaCaminhaoApi(); |
||
| 29 | case Tipo::CARROS: return new ConsultaCarroApi(); |
||
| 30 | } |
||
| 31 | |||
| 32 | throw new \Exception("Tipo {$tipo} não definido"); |
||
| 33 | } |
||
| 34 | } |
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.