Code Duplication    Length = 8-10 lines in 2 locations

ApiFactory/ApiFactoryRegistryFactory.php 1 location

@@ 17-24 (lines=8) @@
14
    private $factories = [];
15
16
    /** {@inheritdoc} */
17
    public function create($alias, RpcClientInterface $client, ApiMetadata $metadata)
18
    {
19
        if (!$this->has($alias)) {
20
            throw ApiFactoryRegistryException::unknown($alias);
21
        }
22
23
        return $this->factories[$alias]->createApi($client, $metadata);
24
    }
25
26
    /** {@inheritdoc} */
27
    public function has($alias)

ApiFactory/StaticApiFactoryFactory.php 1 location

@@ 13-22 (lines=10) @@
10
final class StaticApiFactoryFactory implements ApiFactoryRegistryInterface
11
{
12
    /** {@inheritdoc} */
13
    public function create($alias, RpcClientInterface $client, ApiMetadata $metadata)
14
    {
15
        /** @var StaticApiFactoryInterface $alias */
16
        if (!$this->has($alias)) {
17
            throw ApiFactoryRegistryException::unknown($alias);
18
        }
19
20
        return $alias::createApi($client, $metadata);
21
22
    }
23
24
    /** {@inheritdoc} */
25
    public function has($alias)