This commit is contained in:
2022-06-13 21:36:52 -04:00
parent 3580738273
commit 42a97bb074
100 changed files with 2574 additions and 313 deletions

22
common/Factory/Mapper.php Normal file
View File

@ -0,0 +1,22 @@
<?php
namespace Incoviba\API\Common\Factory;
use Incoviba\Mapper\Mapper as BaseMapper;
use Psr\Container\ContainerInterface;
class Mapper
{
protected ContainerInterface $container;
public function __construct(ContainerInterface $container)
{
$this->container = $container;
}
public function get(string $name): BaseMapper
{
if (!class_exists($name)) {
throw new \InvalidArgumentException();
}
return $this->container->get($name);
}
}