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

NormalizerContext   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 0
dl 0
loc 38
ccs 8
cts 8
cp 1
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getGroups() 0 4 1
A getRequest() 0 4 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