Passed
Push — master ( 01c6a8...5a4258 )
by Jesse
09:00
created

NullValue::inProperty()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
c 0
b 0
f 0
nc 1
nop 1
dl 0
loc 3
rs 10
1
<?php
2
declare(strict_types=1);
3
4
namespace Stratadox\Hydration\Mapping\Property\Type;
5
6
use Stratadox\Hydration\Mapping\DifferentKey;
7
use Stratadox\Hydration\Mapping\Primitive\NullMapping;
8
use Stratadox\Hydration\Mapping\Property\Keyed;
9
use Stratadox\HydrationMapping\KeyedMapping;
10
11
final class NullValue
12
{
13
    public static function inProperty(string $name): KeyedMapping
14
    {
15
        return Keyed::mapping($name, NullMapping::inProperty($name));
16
    }
17
18
    public static function inPropertyWithDifferentKey(
19
        string $name,
20
        string $key
21
    ): KeyedMapping {
22
        return Keyed::mapping($key, DifferentKey::use($key,
23
            NullMapping::inProperty($name)
24
        ));
25
    }
26
}
27