Passed
Push — master ( 924412...d4b74b )
by Jesse
02:02
created

HasOneNested   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 3
dl 0
loc 15
rs 10
c 1
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A inPropertyWithDifferentKey() 0 6 1
A inProperty() 0 5 1
1
<?php
2
declare(strict_types=1);
3
4
namespace Stratadox\Hydration\Mapping\Simple\Relationship;
5
6
use Stratadox\Deserializer\Deserializer;
7
use Stratadox\Hydration\Mapping\Nested;
8
use Stratadox\Hydration\Mapping\Relation\RelationMapping;
9
use Stratadox\HydrationMapping\Mapping;
10
11
final class HasOneNested
12
{
13
    public static function inProperty(
14
        string $name,
15
        Deserializer $deserializer
16
    ): Mapping {
17
        return Nested::inKey($name, RelationMapping::inProperty($name, $deserializer));
18
    }
19
20
    public static function inPropertyWithDifferentKey(
21
        string $name,
22
        string $key,
23
        Deserializer $deserializer
24
    ): Mapping {
25
        return Nested::inKey($key, RelationMapping::inProperty($name, $deserializer));
26
    }
27
}
28