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

AbstractRenderer   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Test Coverage

Coverage 57.14%

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A setForm() 0 4 1
A getForm() 0 3 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
/**
11
 * @deprecated use \Enjoys\Forms\Renderer\Renderer, remove in 6.x
12
 */
13
abstract class AbstractRenderer implements RendererInterface
0 ignored issues
show
Deprecated Code introduced by
The interface Enjoys\Forms\Interfaces\RendererInterface has been deprecated: remove in 6.x ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

13
abstract class AbstractRenderer implements /** @scrutinizer ignore-deprecated */ RendererInterface

This interface has been deprecated. The supplier of the interface has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the interface will be removed and what other interface to use instead.

Loading history...
14
{
15
    private Form $form;
16
17 1
    public function __construct(Form $form = null)
18
    {
19 1
        $this->form = $form ?? new Form();
20
    }
21
22
    abstract public function output(): mixed;
23
24
    public function setForm(Form $form): self
25
    {
26
        $this->form = $form;
27
        return $this;
28
    }
29
30 1
    public function getForm(): Form
31
    {
32 1
        return $this->form;
33
    }
34
}
35