| Total Complexity | 7 |
| Total Lines | 27 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 7 | class Alert extends Component |
||
| 8 | { |
||
| 9 | public $type, $title; |
||
| 10 | public $dismissable; |
||
| 11 | |||
| 12 | public function __construct($type = 'info', $dismissable = false, $title = 'Alert') |
||
| 13 | { |
||
| 14 | $this->type = $type; |
||
| 15 | $this->title = $title; |
||
| 16 | $this->dismissable = $dismissable; |
||
| 17 | } |
||
| 18 | |||
| 19 | public function icon() |
||
| 20 | { |
||
| 21 | switch($this->type) |
||
| 22 | { |
||
| 23 | case 'info' : return 'info' ; break; |
||
|
|
|||
| 24 | case 'warning' : return 'exclamation-triangle' ; break; |
||
| 25 | case 'success' : return 'check' ; break; |
||
| 26 | case 'danger' : return 'ban' ; break; |
||
| 27 | default : return 'exclamation'; break; |
||
| 28 | } |
||
| 29 | } |
||
| 30 | |||
| 31 | public function render() |
||
| 34 | } |
||
| 35 | } |
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.