Test Failed
Push — master ( e97986...2933e0 )
by Bruno
19:41 queued 09:43
created

Renderable_date   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A viewable() 0 3 1
A _editable() 0 13 3
1
<?php declare(strict_types=1);
2
3
namespace Formularium\Frontend\Vuetify\Renderable;
4
5
use Formularium\Field;
6
use Formularium\HTMLNode;
7
use Formularium\Frontend\Vuetify\RenderableVuetifyTrait;
8
9
class Renderable_date extends \Formularium\Renderable
10
{
11
    use RenderableVuetifyTrait;
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('v-date-picker');
34
                    }
35
                }
36
            }
37
        );
38
        return $previous;
39
    }
40
}
41