HasManyProxies::inProperty()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
nc 1
nop 3
dl 0
loc 6
rs 10
c 1
b 0
f 0
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\Transform\KeyTransform;
8
use Stratadox\Hydration\Mapping\Relation\NumberedProxyCollectionMapping;
9
use Stratadox\HydrationMapping\Mapping;
10
use Stratadox\Proxy\ProxyFactory;
11
12
final class HasManyProxies
13
{
14
    public static function inProperty(
15
        string $name,
16
        Deserializer $collection,
17
        ProxyFactory $proxyFactory
18
    ): Mapping {
19
        return NumberedProxyCollectionMapping::inProperty($name, $collection, $proxyFactory);
20
    }
21
22
    public static function inPropertyWithDifferentKey(
23
        string $name,
24
        string $key,
25
        Deserializer $collection,
26
        ProxyFactory $proxyFactory
27
    ): Mapping {
28
        return KeyTransform::use($key, self::inProperty($name, $collection, $proxyFactory));
29
    }
30
}
31