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

Pagination   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getMetadata() 0 4 1
A render() 0 14 1
1
<?php declare(strict_types=1);
2
3
namespace Formularium\Frontend\Vuetify\Element;
4
5
use Formularium\Element;
6
use Formularium\Frontend\HTML\Element\Pagination as HTMLPagination;
7
use Formularium\HTMLNode;
8
use Formularium\Metadata;
9
10
class Pagination extends VuetifyElement
11
{
12
    public function render(array $parameters, HTMLNode $previous): HTMLNode
13
    {
14
        $this->color($parameters, $previous);
15
16
        $name = $parameters[self::NAME] ?? 'paginator';
17
        $p = HTMLNode::factory(
18
            'v-pagination',
19
            [
20
                'v-model' => $name . "." . HTMLPagination::CURRENT_PAGE,
21
                ':length' => $name . "." . HTMLPagination::TOTAL_ITEMS,
22
            ]
23
        );
24
25
        return $p;
26
    }
27
28
    public static function getMetadata(): Metadata
29
    {
30
        $metadata = HTMLPagination::getMetadata();
31
        return $metadata;
32
    }
33
}
34