Passed
Push — master ( 4d9341...54dd2f )
by Dominik
02:16
created

NormalizerContext::getRequest()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Chubbyphp\Serialization\Normalizer;
6
7
use Psr\Http\Message\ServerRequestInterface;
8
9
final class NormalizerContext implements NormalizerContextInterface
10
{
11
    /**
12
     * @var string[]
13
     */
14
    private $groups = [];
15
16
    /**
17
     * @var ServerRequestInterface|null
18
     */
19
    private $request;
20
21
    /**
22
     * @param string[] $groups
23
     * @param ServerRequestInterface|null $request
24
     */
25 2
    public function __construct(array $groups = [], ServerRequestInterface $request = null)
26
    {
27 2
        $this->groups = $groups;
28 2
        $this->request = $request;
29 2
    }
30
31
    /**
32
     * @return string[]
33
     */
34 2
    public function getGroups(): array
35
    {
36 2
        return $this->groups;
37
    }
38
39
    /**
40
     * @return ServerRequestInterface|null
41
     */
42 2
    public function getRequest()
43
    {
44 2
        return $this->request;
45
    }
46
}
47