Skip to content

Commit e91cbe8

Browse files
committed
Implement ArrayMapper class compile method
1 parent 7e8f697 commit e91cbe8

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/Mapping/Composite/ArrayMapper.php

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace Kiboko\Component\ETL\FastMap\Mapping\Composite;
44

55
use Kiboko\Component\ETL\FastMap\Contracts;
6+
use \Kiboko\Component\ETL\FastMap\Contracts\CompilableInterface;
67
use Symfony\Component\PropertyAccess\PropertyAccess;
78
use Symfony\Component\PropertyAccess\PropertyAccessor;
89
use Symfony\Component\PropertyAccess\PropertyPathInterface;
@@ -42,6 +43,13 @@ public function __invoke($input, $output, PropertyPathInterface $outputPath)
4243

4344
public function compile(Node\Expr $outputNode): array
4445
{
45-
// TODO: Implement compile() method.
46+
$output = [];
47+
foreach ($this->fields as $field) {
48+
if ($field instanceof CompilableInterface) {
49+
$output = array_merge($output, $field->compile($outputNode));
50+
}
51+
}
52+
53+
return $output;
4654
}
47-
}
55+
}

0 commit comments

Comments
 (0)