Conditions | 5 |
Paths | 5 |
Total Lines | 20 |
Code Lines | 17 |
Lines | 0 |
Ratio | 0 % |
Changes | 3 | ||
Bugs | 0 | Features | 0 |
1 | <?php namespace Modules\Blog\Presenters; |
||
55 | public function statusLabelClass() |
||
56 | { |
||
57 | switch ($this->entity->status) { |
||
58 | case Status::DRAFT: |
||
59 | return 'bg-red'; |
||
60 | break; |
||
|
|||
61 | case Status::PENDING: |
||
62 | return 'bg-orange'; |
||
63 | break; |
||
64 | case Status::PUBLISHED: |
||
65 | return 'bg-green'; |
||
66 | break; |
||
67 | case Status::UNPUBLISHED: |
||
68 | return 'bg-purple'; |
||
69 | break; |
||
70 | default: |
||
71 | return 'bg-red'; |
||
72 | break; |
||
73 | } |
||
74 | } |
||
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.