Completed
Push — master ( c833c1...b511be )
by Song
03:16
created

RadioCard   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A addStyle() 0 20 1
A render() 0 6 1
1
<?php
2
3
namespace Encore\Admin\Form\Field;
4
5
use Encore\Admin\Admin;
6
7
class RadioCard extends RadioButton
8
{
9
    protected function addStyle()
10
    {
11
        $style = <<<STYLE
12
.card-group label {
13
    cursor: pointer;
14
    margin-right: 8px;
15
    font-weight: 400;
16
}
17
18
.card-group .panel-body {
19
    padding: 10px 15px;
20
}
21
22
.card-group .active {
23
    border: 2px solid #367fa9;
24
}
25
STYLE;
26
27
        Admin::style($style);
28
    }
29
30
    /**
31
     * {@inheritdoc}
32
     */
33
    public function render()
34
    {
35
        $this->addStyle();
36
37
        return parent::render();
0 ignored issues
show
Bug Compatibility introduced by
The expression parent::render(); of type string|Illuminate\View\V...\Contracts\View\Factory adds the type Illuminate\Contracts\View\Factory to the return on line 37 which is incompatible with the return type declared by the interface Illuminate\Contracts\Support\Renderable::render of type string.
Loading history...
38
    }
39
}
40