Passed
Push — master ( d1cf1e...a6740f )
by Bruno
06:44
created

Renderable_time   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 9
c 1
b 0
f 0
dl 0
loc 30
rs 10
wmc 4

2 Methods

Rating   Name   Duplication   Size   Complexity  
A _editable() 0 13 3
A viewable() 0 3 1
1
<?php declare(strict_types=1);
2
3
namespace Formularium\Frontend\Buefy\Renderable;
4
5
use Formularium\Field;
6
use Formularium\Frontend\Buefy\RenderableBuefyTrait;
7
use Formularium\HTMLElement;
8
9
class Renderable_time extends \Formularium\Renderable
10
{
11
    use RenderableBuefyTrait;
12
13
    public function viewable($value, Field $field, HTMLElement $previous): HTMLElement
14
    {
15
        return $previous;
16
    }
17
18
    /**
19
     * Subcall of wrapper editable() from RenderableMaterializeTrait
20
     *
21
     * @param mixed $value
22
     * @param Field $field
23
     * @param HTMLElement $previous
24
     * @return HTMLElement
25
     */
26
    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

26
    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

26
    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...
27
    {
28
        // add extra classes
29
        $previous->walk(
30
            function ($e) {
31
                if ($e instanceof HTMLElement) {
32
                    if ($e->getTag() === 'input') {
33
                        $e->setTag('b-clockpicker');
34
                    }
35
                }
36
            }
37
        );
38
        return $previous;
39
    }
40
}
41