Conditions | 7 |
Paths | 7 |
Total Lines | 17 |
Code Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
18 | public static function sportFromCode(string $code) : string |
||
19 | { |
||
20 | switch (strtolower(trim($code))) { |
||
21 | case SportMapperInterface::RUNNING: |
||
22 | case 'run': |
||
23 | return SportMapperInterface::RUNNING; |
||
24 | case SportMapperInterface::CYCLING_SPORT: |
||
25 | case 'cycling': |
||
26 | return SportMapperInterface::CYCLING_SPORT; |
||
27 | case SportMapperInterface::CYCLING_TRANSPORT: |
||
28 | return SportMapperInterface::CYCLING_TRANSPORT; |
||
29 | case SportMapperInterface::SWIMMING: |
||
30 | return SportMapperInterface::SWIMMING; |
||
31 | default: |
||
32 | return SportMapperInterface::OTHER; |
||
33 | } |
||
34 | } |
||
35 | } |
||
36 |