BlockPresenter::onlineLabel()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 8
rs 10
c 0
b 0
f 0
cc 2
nc 2
nop 0
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