Passed
Push — master ( 192b45...fd1497 )
by Bruno
06:54
created

Element   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Test Coverage

Coverage 81.82%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 6
dl 0
loc 38
ccs 9
cts 11
cp 0.8182
rs 10
c 1
b 0
f 1
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
1
<?php declare(strict_types=1);
2
3
namespace Formularium;
4
5
use Formularium\Exception\ClassNotFoundException;
6
use Formularium\HTMLNode;
7
8
/**
9
 * Abstract base classe to render HTML elements such as buttons.
10
 */
11
abstract class Element implements RenderableParameter
12
{
13
    /**
14
     * extra attributes added directly to the base element.
15
     */
16
    const ATTRIBUTES = 'attributes';
17
18
    /**
19
     * @var Framework
20
     */
21
    protected $framework;
22
23
    /**
24
     * @var FrameworkComposer
25 1
     */
26
    protected $composer;
27
28 1
    public function __construct(Framework $framework, FrameworkComposer $composer = null)
29 1
    {
30 1
        $this->framework = $framework;
31
        $this->composer = $composer;
32
    }
33 1
34
    /**
35 1
     * Renders a form editable version of this Element
36 1
     *
37
     * @param array $parameters
38
     * @param HTMLNode $previous
39 1
     * @return HTMLNode The HTML rendered.
40
     */
41
    abstract public function render(array $parameters, HTMLNode $previous): HTMLNode;
42
43
    /**
44
     * Documents this validator.
45
     *
46
     * @return Metadata
47 1
     */
48
    abstract public static function getMetadata(): Metadata;
49
}
50