Listing::addTransformer()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 2
c 1
b 0
f 0
dl 0
loc 4
ccs 3
cts 3
cp 1
rs 10
cc 1
nc 1
nop 1
crap 1
1
<?php
2
3
namespace Riesenia\Pohoda\ValueTransformer;
4
5
class Listing
6
{
7
    /**
8
     * A set of transformers that will be used when serializing data.
9
     *
10
     * @var ValueTransformerInterface[]
11
     */
12
    protected array $list = [];
13
14
    /**
15
     * @return ValueTransformerInterface[]
16
     */
17 95
    public function getTransformers(): array
18
    {
19 95
        return $this->list;
20
    }
21
22 7
    public function addTransformer(ValueTransformerInterface $transformer): self
23
    {
24 7
        $this->list[] = $transformer;
25 7
        return $this;
26
    }
27
28 6
    public function clear(): self
29
    {
30 6
        $this->list = [];
31 6
        return $this;
32
    }
33
}
34