| 1 | <?php |
||
| 23 | class ContentFactory |
||
| 24 | { |
||
| 25 | /** |
||
| 26 | * @const string |
||
| 27 | */ |
||
| 28 | const EXT_TXT = 'txt'; |
||
| 29 | |||
| 30 | /** |
||
| 31 | * @const string |
||
| 32 | */ |
||
| 33 | const EXT_JSON = 'json'; |
||
| 34 | |||
| 35 | /** |
||
| 36 | * @const string |
||
| 37 | */ |
||
| 38 | const EXT_YAML = 'yaml'; |
||
| 39 | |||
| 40 | /** |
||
| 41 | * @const string |
||
| 42 | */ |
||
| 43 | const EXT_YML = 'yml'; |
||
| 44 | |||
| 45 | /** |
||
| 46 | * Create a ContentInterface based on the extension and string content |
||
| 47 | * @param string $extension |
||
| 48 | * @param string $content |
||
| 49 | * @return \NeedleProject\FileIo\Content\ContentInterface |
||
| 50 | */ |
||
| 51 | 8 | public function create(string $extension, string $content): ContentInterface |
|
| 75 | } |
||
| 76 |
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.