| Conditions | 9 |
| Paths | 9 |
| Total Lines | 28 |
| Code Lines | 22 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 25 | public function render($state) |
||
| 26 | { |
||
| 27 | |||
| 28 | $key = ""; |
||
| 29 | |||
| 30 | switch ($state) { |
||
| 31 | case \EWW\Dpf\Domain\Model\Document::OBJECT_STATE_NEW: |
||
| 32 | $key = 'search.resultList.state.new'; |
||
| 33 | break; |
||
| 34 | case \EWW\Dpf\Domain\Model\Document::OBJECT_STATE_ACTIVE: |
||
| 35 | case 'A': |
||
| 36 | $key = 'search.resultList.state.active'; |
||
| 37 | break; |
||
| 38 | case \EWW\Dpf\Domain\Model\Document::OBJECT_STATE_INACTIVE: |
||
| 39 | case 'I': |
||
| 40 | $key = 'search.resultList.state.inactive'; |
||
| 41 | break; |
||
| 42 | case \EWW\Dpf\Domain\Model\Document::OBJECT_STATE_DELETED: |
||
| 43 | case \EWW\Dpf\Domain\Model\Document::OBJECT_STATE_LOCALLY_DELETED: |
||
| 44 | case 'D': |
||
| 45 | $key = 'search.resultList.state.deleted'; |
||
| 46 | break; |
||
| 47 | default: |
||
| 48 | return "-"; |
||
| 49 | break; |
||
|
|
|||
| 50 | } |
||
| 51 | |||
| 52 | return \TYPO3\CMS\Extbase\Utility\LocalizationUtility::translate($key, 'dpf', $arguments = null); |
||
| 53 | } |
||
| 55 |
The
breakstatement is not necessary if it is preceded for example by areturnstatement:If you would like to keep this construct to be consistent with other
casestatements, you can safely mark this issue as a false-positive.