Passed
Push — 5.x ( 65a76f...3a1e20 )
by Enjoys
59s queued 13s
created

AbstractRenderer::getForm()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 1
c 1
b 0
f 1
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
cc 1
nc 1
nop 0
crap 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Enjoys\Forms\Renderer;
6
7
use Enjoys\Forms\Form;
8
use Enjoys\Forms\Interfaces\RendererInterface;
9
10
abstract class AbstractRenderer implements RendererInterface
11
{
12
    private Form $form;
13
14 1
    public function __construct(Form $form = null)
15
    {
16 1
        $this->form = $form ?? new Form();
17
    }
18
19
    abstract public function output(): string;
20
21 1
    public function setForm(Form $form): Form
22
    {
23 1
        $this->form = $form;
24 1
        return $this->form;
25
    }
26
27 1
    public function getForm(): Form
28
    {
29 1
        return $this->form;
30
    }
31
}
32