Renderable_time::_editable()   A
last analyzed

Complexity

Conditions 3
Paths 1

Size

Total Lines 13
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 3
eloc 6
nc 1
nop 3
dl 0
loc 13
rs 10
c 0
b 0
f 0
1
<?php declare(strict_types=1);
2
3
namespace Formularium\Frontend\Bootstrapvue\Renderable;
4
5
use Formularium\Field;
6
use Formularium\Frontend\Bootstrapvue\RenderableBootstrapvueTrait;
7
use Formularium\HTMLNode;
8
9
class Renderable_time extends \Formularium\Renderable
10
{
11
    use RenderableBootstrapvueTrait;
12
13
    public function viewable($value, Field $field, HTMLNode $previous): HTMLNode
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 HTMLNode $previous
24
     * @return HTMLNode
25
     */
26
    public function _editable($value, Field $field, HTMLNode $previous): HTMLNode
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, HTMLNode $previous): HTMLNode

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, HTMLNode $previous): HTMLNode

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 HTMLNode) {
32
                    if ($e->getTag() === 'input') {
33
                        $e->setTag('b-form-timepicker');
34
                    }
35
                }
36
            }
37
        );
38
        return $previous;
39
    }
40
}
41