Total Complexity | 5 |
Total Lines | 40 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php declare(strict_types=1); |
||
9 | final class RelationMapping implements Mapping |
||
10 | { |
||
11 | /** @var string */ |
||
12 | private $name; |
||
13 | /** @var Deserializer */ |
||
14 | private $deserialize; |
||
15 | |||
16 | private function __construct(string $name, Deserializer $deserializer) |
||
17 | { |
||
18 | $this->name = $name; |
||
19 | $this->deserialize = $deserializer; |
||
20 | } |
||
21 | |||
22 | /** |
||
23 | * Creates a new has-one mapping. |
||
24 | * |
||
25 | * @param string $name The name of the property. |
||
26 | * @param Deserializer $deserializer The deserializer for the related object. |
||
27 | * @return Mapping The has-one mapping. |
||
28 | */ |
||
29 | public static function inProperty( |
||
34 | } |
||
35 | |||
36 | /** @inheritdoc */ |
||
37 | public function name(): string |
||
38 | { |
||
39 | return $this->name; |
||
40 | } |
||
41 | |||
42 | /** @inheritdoc */ |
||
43 | public function value(array $data, $owner = null) |
||
49 | } |
||
50 | } |
||
51 | } |
||
52 |