Completed
Pull Request — master (#2)
by Tomasz
01:59
created

ParentNormalizerContext::withParent()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 7
ccs 4
cts 4
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 4
nc 1
nop 1
crap 1
1
<?php
2
namespace Thunder\Serializard\NormalizerContext;
3
4
final class ParentNormalizerContext implements NormalizerContextInterface
5
{
6
    private $parent;
7
8 10
    public function __construct()
9
    {
10 10
    }
11
12 9
    public function withParent($parent)
13
    {
14 9
        $context = new self();
15 9
        $context->parent = $parent;
16
17 9
        return $context;
18
    }
19
20 1
    public function getParent()
21
    {
22 1
        return $this->parent;
23
    }
24
}
25