| Total Complexity | 7 |
| Total Lines | 40 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 19 | final class Mapper implements MakesMap |
||
| 20 | { |
||
| 21 | private $name; |
||
| 22 | private $properties; |
||
| 23 | |||
| 24 | private function __construct(string $name, array $properties = []) |
||
| 25 | { |
||
| 26 | $this->name = $name; |
||
| 27 | $this->properties = $properties; |
||
| 28 | } |
||
| 29 | |||
| 30 | public static function forThe(string $className) : self |
||
| 31 | { |
||
| 32 | return new self($className); |
||
| 33 | } |
||
| 34 | |||
| 35 | public function property( |
||
| 41 | } |
||
| 42 | |||
| 43 | public function finish() : Hydrates |
||
| 44 | { |
||
| 45 | $class = $this->name; |
||
| 46 | $properties = []; |
||
| 47 | foreach ($this->properties as $name => $instruction) { |
||
| 48 | $properties[] = $instruction->followFor($name); |
||
| 49 | } |
||
| 50 | return MappedHydrator::forThe($class, Properties::map(...$properties)); |
||
| 51 | } |
||
| 52 | |||
| 53 | private function add( |
||
| 59 | } |
||
| 60 | } |
||
| 61 |