Completed
Push — master ( a7b5fe...4405b1 )
by wen
03:16
created

Badge::toArray()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 8
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 4
nc 2
nop 0
1
<?php
2
3
namespace Sco\Admin\Navigation;
4
5
class Badge extends \KodiComponents\Navigation\Badge
6
{
7
    public function toArray()
8
    {
9
        if (!$this->hasClassProperty('label-', 'bg-')) {
10
            $this->setHtmlAttribute('class', 'label-primary');
11
        }
12
13
        return ['value' => $this->getValue()] + $this->getHtmlAttributes();
14
    }
15
}
16