| Total Complexity | 7 |
| Total Lines | 51 |
| Duplicated Lines | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 16 | final class HasManyEmbedded implements Mapping |
||
| 17 | { |
||
| 18 | /** @var string */ |
||
| 19 | private $name; |
||
| 20 | /** @var Deserializer */ |
||
| 21 | private $collection; |
||
| 22 | /** @var Deserializer */ |
||
| 23 | private $item; |
||
| 24 | /** @var string */ |
||
| 25 | private $key; |
||
| 26 | |||
| 27 | private function __construct( |
||
| 28 | string $name, |
||
| 29 | Deserializer $collection, |
||
| 30 | Deserializer $item, |
||
| 31 | string $key |
||
| 32 | ) { |
||
| 33 | $this->name = $name; |
||
| 34 | $this->collection = $collection; |
||
| 35 | $this->item = $item; |
||
| 36 | $this->key = $key; |
||
| 37 | } |
||
| 38 | |||
| 39 | public static function inProperty( |
||
| 40 | string $name, |
||
| 41 | Deserializer $collection, |
||
| 42 | Deserializer $item, |
||
| 43 | string $key = 'key' |
||
| 44 | ): Mapping { |
||
| 45 | return new self($name, $collection, $item, $key); |
||
| 46 | } |
||
| 47 | |||
| 48 | public function name(): string |
||
| 49 | { |
||
| 50 | return $this->name; |
||
| 51 | } |
||
| 52 | |||
| 53 | public function value(array $data, $owner = null) |
||
| 67 | } |
||
| 68 | } |
||
| 69 | } |
||
| 70 |