Passed
Push — master ( 089a6d...7b13b9 )
by Bruno
06:38
created

Renderable_file   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 19
c 1
b 0
f 0
dl 0
loc 31
ccs 0
cts 25
cp 0
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A _editable() 0 27 1
1
<?php declare(strict_types=1);
2
3
namespace Formularium\Frontend\Materialize\Renderable;
4
5
use Formularium\Field;
6
use Formularium\Frontend\Materialize\RenderableMaterializeInputTrait;
7
use Formularium\HTMLElement;
8
9
class Renderable_file extends \Formularium\Renderable
10
{
11
    use RenderableMaterializeInputTrait;
12
    
13
    public function _editable($value, Field $field, HTMLElement $previous): HTMLElement
0 ignored issues
show
Unused Code introduced by
The parameter $value is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

13
    public function _editable(/** @scrutinizer ignore-unused */ $value, Field $field, HTMLElement $previous): HTMLElement

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $field is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

13
    public function _editable($value, /** @scrutinizer ignore-unused */ Field $field, HTMLElement $previous): HTMLElement

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
14
    {
15
        // add extra classes
16
        $input = $previous->get('input')[0];
17
18
        return HTMLElement::factory(
19
            'div',
20
            ['class' => 'file-field'],
21
            [
22
                HTMLElement::factory(
23
                    'div',
24
                    ['class' => "btn"],
25
                    [
26
                        HTMLElement::factory(
27
                            'span',
28
                            [],
29
                            'Upload'
30
                        ),
31
                        $input
32
                    ]
33
                ),
34
                HTMLElement::factory(
35
                    'div',
36
                    ['class' => "file-path-wrapper"],
37
                    HTMLElement::factory(
38
                        'input',
39
                        ['class' => 'file-path validate', 'type' => 'text']
40
                    )
41
                )
42
            ]
43
        );
44
    }
45
}
46