Total Complexity | 4 |
Total Lines | 27 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php declare(strict_types=1); |
||
8 | final class NestingTransform implements Mapping |
||
9 | { |
||
10 | /** @var string */ |
||
11 | private $key; |
||
12 | /** @var Mapping */ |
||
13 | private $mapping; |
||
14 | |||
15 | private function __construct(string $key, Mapping $mapping) |
||
16 | { |
||
17 | $this->key = $key; |
||
18 | $this->mapping = $mapping; |
||
19 | } |
||
20 | |||
21 | public static function inKey(string $key, Mapping $mapping): Mapping |
||
22 | { |
||
23 | return new self($key, $mapping); |
||
24 | } |
||
25 | |||
26 | public function name(): string |
||
27 | { |
||
28 | return $this->mapping->name(); |
||
29 | } |
||
30 | |||
31 | public function value(array $data, $owner = null) |
||
35 | } |
||
36 | } |
||
37 |