BlockPresenter   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 0
dl 0
loc 15
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A onlineLabel() 0 8 2
1
<?php
2
3
namespace Modules\Block\Presenters;
4
5
use Laracasts\Presenter\Presenter;
6
7
class BlockPresenter extends Presenter
8
{
9
    /**
10
     * Get a bootstrap label of the block is online or offline
11
     * @return string
12
     */
13
    public function onlineLabel()
14
    {
15
        if ($this->entity->online) {
16
            return '<span class="label label-success">Online</span>';
17
        }
18
19
        return '<span class="label label-default">Offline</span>';
20
    }
21
}
22