Code

< 40 %
40-60 %
> 60 %
1
<?php
2
3
namespace Bankiru\Api\Doctrine;
4
5
use Bankiru\Api\Doctrine\ApiFactory\StaticApiFactoryFactory;
6
7
final class ConstructorFactoryResolver implements ApiFactoryResolverInterface
8
{
9
    /** @var  ApiFactoryInterface[] */
10
    private $factories = [];
11
12
    /** {@inheritdoc} */
13
    public function resolve($name)
14
    {
15
        if (!array_key_exists($name, $this->factories)) {
16
            $this->factories[$name] = new StaticApiFactoryFactory($name);
17
        }
18
19
        return $this->factories[$name];
20
    }
21
}
22