Passed
Push — 5.x ( 86d107...64b5d9 )
by Enjoys
14:02
created

Renderer::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 0
Metric Value
eloc 1
c 1
b 0
f 0
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
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