Passed
Push — master ( 99d1d4...64b5d9 )
by Enjoys
15:28
created

Renderer   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 3
Bugs 0 Features 0
Metric Value
wmc 3
eloc 6
dl 0
loc 20
ccs 7
cts 7
cp 1
rs 10
c 3
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A getForm() 0 3 1
A setForm() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Enjoys\Forms\Renderer;
6
7
use Enjoys\Forms\Form;
8
9
10
abstract class Renderer
11
{
12
    private Form $form;
13
14 2
    public function __construct(Form $form = null)
15
    {
16 2
        $this->form = $form ?? new Form();
17
    }
18
19
    abstract public function output(): mixed;
20
21 2
    public function setForm(Form $form): self
22
    {
23 2
        $this->form = $form;
24 2
        return $this;
25
    }
26
27 2
    public function getForm(): Form
28
    {
29 2
        return $this->form;
30
    }
31
}
32