Actualización

This commit is contained in:
Xes
2025-04-10 12:24:57 +02:00
parent 8969cc929d
commit 45420b6f0d
39760 changed files with 4303286 additions and 0 deletions

View File

@@ -0,0 +1,36 @@
<?php
namespace Ddeboer\DataImport\ValueConverter;
use Ddeboer\DataImport\Exception\UnexpectedValueException;
/**
* @author Grégoire Paris
*/
class MappingValueConverter
{
/**
* @var array
*/
private $mapping = [];
/**
* @param array $mapping
*/
public function __construct(array $mapping)
{
$this->mapping = $mapping;
}
public function __invoke($input)
{
if (!isset($this->mapping[$input])) {
throw new UnexpectedValueException(sprintf(
'Cannot find mapping for value "%s"',
$input
));
}
return $this->mapping[$input];
}
}