| Conditions | 5 |
| Paths | 5 |
| Total Lines | 23 |
| Code Lines | 17 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 21 | public function display(array $properties) |
||
| 22 | { |
||
| 23 | if (!$this->hasPermission('fincludeblock::', "$properties[title]::", ACCESS_READ)) { |
||
| 24 | return ''; |
||
| 25 | } |
||
| 26 | |||
| 27 | switch ($properties['typo']) { |
||
| 28 | case 0: // Html |
||
| 29 | return file_get_contents($properties['filo']); |
||
| 30 | break; |
||
|
|
|||
| 31 | case 1: // Text |
||
| 32 | return htmlspecialchars(file_get_contents($properties['filo'])); |
||
| 33 | break; |
||
| 34 | case 2: // PHP |
||
| 35 | ob_start(); |
||
| 36 | include \DataUtil::formatForOS($properties['filo']); |
||
| 37 | |||
| 38 | return ob_get_clean(); |
||
| 39 | break; |
||
| 40 | default: |
||
| 41 | return ''; |
||
| 42 | } |
||
| 43 | } |
||
| 44 | |||
| 60 |
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.