From b0a28a0eb564cdfb48f83ef30f57868a59c85f11 Mon Sep 17 00:00:00 2001 From: Paul Date: Mon, 12 Jun 2017 11:38:23 +0100 Subject: [PATCH] Changed CollectionMapper to map any expression type instead of just Mappings. --- src/CollectionMapper.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/CollectionMapper.php b/src/CollectionMapper.php index fdcacb5..5cd8232 100644 --- a/src/CollectionMapper.php +++ b/src/CollectionMapper.php @@ -1,6 +1,8 @@ $record) { if (!is_array($record)) { throw new InvalidRecordException('Record must be an array.'); } - yield $key => $mapping - ? $this->mapMapping($record, $mapping, $context, $key) + yield $key => $expression !== null + ? $this->mapMapping($record, $expression, $context, $key) : $record; } }