Completed
Push — master ( 839e9e...4e091b )
by Costin
03:53
created

CheckboxComponent   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A toHtml() 0 8 1
1
<?php 
2
3
namespace SoareCostin\BladeFormComponents\FormComponents;
4
5
use Illuminate\Contracts\Support\Htmlable;
6
use SoareCostin\BladeFormComponents\FormElements\Checkbox;
7
8
class CheckboxComponent implements Htmlable
9
{
10
    /** @var SoareCostin\BladeFormComponents\FormElements\Checkbox */
11
    protected $element;
12
13
    public function __construct(array $params = [])
14
    {
15
        $this->element = new Checkbox($params);
0 ignored issues
show
Documentation Bug introduced by
It seems like new \SoareCostin\BladeFo...ments\Checkbox($params) of type object<SoareCostin\Blade...\FormElements\Checkbox> is incompatible with the declared type object<SoareCostin\Blade...\FormElements\Checkbox> of property $element.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
16
    }
17
18
    public function toHtml()
19
    {
20
        $theme = config('blade-form-components.theme');
21
22
        return view(
23
            'blade-form-components::themes.'.$theme.'.checkbox', ['element' => $this->element]
24
        );
25
    }
26
}
27