Lookup mapper

A lookup mapper is a class that implements Kiboko\Contract\Mapping\CompiledMapperInterface.

Its purpose is to merge the result of the lookup back into your line.

$output is your line, and $input is the result of the lookup.

<?php

declare(strict_types=1);

namespace Acme\Custom;

use Kiboko\Contract\Mapping\CompiledMapperInterface;

class LookupMapper implements CompiledMapperInterface
{
    public function __invoke($input, $output = null)
    {
        $output['actual_customer_id'] = $input['id'];

        return $output;
    }
}