Code Duplication    Length = 20-20 lines in 2 locations

DependencyInjection/SpomkyLabsJoseBundleExtension.php 2 locations

@@ 293-312 (lines=20) @@
290
        return $services;
291
    }
292
293
    private function createJWKSources()
294
    {
295
        if (null !== $this->jwk_sources) {
296
            return $this->jwk_sources;
297
        }
298
299
        // load bundled adapter factories
300
        $tempContainer = new ContainerBuilder();
301
        $loader = new XmlFileLoader($tempContainer, new FileLocator(__DIR__.'/../Resources/config'));
302
        $loader->load('jwk_sources.xml');
303
304
        $services = $tempContainer->findTaggedServiceIds('jose.jwk_source');
305
        $jwk_sources = [];
306
        foreach (array_keys($services) as $id) {
307
            $factory = $tempContainer->get($id);
308
            $jwk_sources[str_replace('-', '_', $factory->getKey())] = $factory;
309
        }
310
311
        return $this->jwk_sources = $jwk_sources;
312
    }
313
314
    private function createJWKSetSources()
315
    {
@@ 314-333 (lines=20) @@
311
        return $this->jwk_sources = $jwk_sources;
312
    }
313
314
    private function createJWKSetSources()
315
    {
316
        if (null !== $this->jwk_set_sources) {
317
            return $this->jwk_set_sources;
318
        }
319
320
        // load bundled adapter factories
321
        $tempContainer = new ContainerBuilder();
322
        $loader = new XmlFileLoader($tempContainer, new FileLocator(__DIR__.'/../Resources/config'));
323
        $loader->load('jwk_set_sources.xml');
324
325
        $services = $tempContainer->findTaggedServiceIds('jose.jwk_set_source');
326
        $jwk_set_sources = [];
327
        foreach (array_keys($services) as $id) {
328
            $factory = $tempContainer->get($id);
329
            $jwk_set_sources[str_replace('-', '_', $factory->getKeySet())] = $factory;
330
        }
331
332
        return $this->jwk_set_sources = $jwk_set_sources;
333
    }
334
}
335