| Conditions | 3 |
| Paths | 3 |
| Total Lines | 17 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 12 |
| Changes | 0 | ||
| 1 | <?php |
||
| 40 | public function create(string $extension, string $content): ContentInterface |
||
| 41 | { |
||
| 42 | switch ($extension) { |
||
| 43 | /** |
||
| 44 | * Create JSON Content |
||
| 45 | */ |
||
| 46 | case static::EXT_JSON: |
||
| 47 | return new JsonContent($content); |
||
| 48 | break; |
||
|
|
|||
| 49 | /** |
||
| 50 | * Default TXT Content |
||
| 51 | */ |
||
| 52 | case static::EXT_TXT: |
||
| 53 | default: |
||
| 54 | return new Content($content); |
||
| 55 | } |
||
| 56 | } |
||
| 57 | } |
||
| 58 |
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.