Code Duplication    Length = 20-20 lines in 2 locations

DependencyInjection/SpomkyLabsJoseBundleExtension.php 2 locations

@@ 267-286 (lines=20) @@
264
        return $services;
265
    }
266
267
    private function createJWKSources()
268
    {
269
        if (null !== $this->jwk_sources) {
270
            return $this->jwk_sources;
271
        }
272
273
        // load bundled adapter factories
274
        $tempContainer = new ContainerBuilder();
275
        $loader = new XmlFileLoader($tempContainer, new FileLocator(__DIR__.'/../Resources/config'));
276
        $loader->load('jwk_sources.xml');
277
278
        $services = $tempContainer->findTaggedServiceIds('jose.jwk_source');
279
        $jwk_sources = [];
280
        foreach (array_keys($services) as $id) {
281
            $factory = $tempContainer->get($id);
282
            $jwk_sources[str_replace('-', '_', $factory->getKey())] = $factory;
283
        }
284
285
        return $this->jwk_sources = $jwk_sources;
286
    }
287
288
    private function createJWKSetSources()
289
    {
@@ 288-307 (lines=20) @@
285
        return $this->jwk_sources = $jwk_sources;
286
    }
287
288
    private function createJWKSetSources()
289
    {
290
        if (null !== $this->jwk_set_sources) {
291
            return $this->jwk_set_sources;
292
        }
293
294
        // load bundled adapter factories
295
        $tempContainer = new ContainerBuilder();
296
        $loader = new XmlFileLoader($tempContainer, new FileLocator(__DIR__.'/../Resources/config'));
297
        $loader->load('jwk_set_sources.xml');
298
299
        $services = $tempContainer->findTaggedServiceIds('jose.jwk_set_source');
300
        $jwk_set_sources = [];
301
        foreach (array_keys($services) as $id) {
302
            $factory = $tempContainer->get($id);
303
            $jwk_set_sources[str_replace('-', '_', $factory->getKeySet())] = $factory;
304
        }
305
306
        return $this->jwk_set_sources = $jwk_set_sources;
307
    }
308
}
309