Code Duplication    Length = 20-20 lines in 2 locations

DependencyInjection/SpomkyLabsJoseBundleExtension.php 2 locations

@@ 346-365 (lines=20) @@
343
        return $services;
344
    }
345
346
    private function createJWKSources()
347
    {
348
        if (null !== $this->jwk_sources) {
349
            return $this->jwk_sources;
350
        }
351
352
        // load bundled adapter factories
353
        $tempContainer = new ContainerBuilder();
354
        $loader = new XmlFileLoader($tempContainer, new FileLocator(__DIR__.'/../Resources/config'));
355
        $loader->load('jwk_sources.xml');
356
357
        $services = $tempContainer->findTaggedServiceIds('jose.jwk_source');
358
        $jwk_sources = [];
359
        foreach (array_keys($services) as $id) {
360
            $factory = $tempContainer->get($id);
361
            $jwk_sources[str_replace('-', '_', $factory->getKey())] = $factory;
362
        }
363
364
        return $this->jwk_sources = $jwk_sources;
365
    }
366
367
    private function createJWKSetSources()
368
    {
@@ 367-386 (lines=20) @@
364
        return $this->jwk_sources = $jwk_sources;
365
    }
366
367
    private function createJWKSetSources()
368
    {
369
        if (null !== $this->jwk_set_sources) {
370
            return $this->jwk_set_sources;
371
        }
372
373
        // load bundled adapter factories
374
        $tempContainer = new ContainerBuilder();
375
        $loader = new XmlFileLoader($tempContainer, new FileLocator(__DIR__.'/../Resources/config'));
376
        $loader->load('jwk_set_sources.xml');
377
378
        $services = $tempContainer->findTaggedServiceIds('jose.jwk_set_source');
379
        $jwk_set_sources = [];
380
        foreach (array_keys($services) as $id) {
381
            $factory = $tempContainer->get($id);
382
            $jwk_set_sources[str_replace('-', '_', $factory->getKeySet())] = $factory;
383
        }
384
385
        return $this->jwk_set_sources = $jwk_set_sources;
386
    }
387
}
388