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

Upload   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 13
c 1
b 0
f 0
dl 0
loc 26
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A render() 0 16 1
A getMetadata() 0 4 1
1
<?php declare(strict_types=1);
2
3
namespace Formularium\Frontend\Vuetify\Element;
4
5
use Formularium\Element;
6
use Formularium\HTMLNode;
7
use Formularium\Frontend\HTML\Element\Upload as HTMLUpload;
8
use Formularium\Frontend\HTML\Framework as HTMLFramework;
9
use Formularium\Metadata;
10
use Formularium\MetadataParameter;
11
12
class Upload extends VuetifyElement
13
{
14
    public function render(array $parameters, HTMLNode $previous): HTMLNode
15
    {
16
        $id = 'upload' . HTMLFramework::counter();
17
        $vmodel = 'file'; // TODO: test
18
        return HTMLNode::factory(
19
            'div',
20
            [
21
                'class' => 'formularium-upload'
22
            ],
23
            HTMLNode::factory(
24
                'v-file-input',
25
                [
26
                    'id' => $id,
27
                    'v-model' => $vmodel,
28
                ],
29
                $parameters[self::LABEL] ?? ''
30
            )
31
        );
32
    }
33
34
    public static function getMetadata(): Metadata
35
    {
36
        $metadata = HTMLUpload::getMetadata();
37
        return $metadata;
38
    }
39
}
40