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

Element::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1.0156

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 2
nc 1
nop 2
dl 0
loc 4
ccs 3
cts 4
cp 0.75
crap 1.0156
rs 10
c 1
b 0
f 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