Code Duplication    Length = 20-20 lines in 2 locations

DependencyInjection/SpomkyLabsJoseBundleExtension.php 2 locations

@@ 160-179 (lines=20) @@
157
        return $services;
158
    }
159
160
    private function createJWKSources()
161
    {
162
        if (null !== $this->jwk_sources) {
163
            return $this->jwk_sources;
164
        }
165
166
        // load bundled adapter factories
167
        $tempContainer = new ContainerBuilder();
168
        $loader = new XmlFileLoader($tempContainer, new FileLocator(__DIR__.'/../Resources/config'));
169
        $loader->load('jwk_sources.xml');
170
171
        $services = $tempContainer->findTaggedServiceIds('jose.jwk_source');
172
        $jwk_sources = [];
173
        foreach (array_keys($services) as $id) {
174
            $factory = $tempContainer->get($id);
175
            $jwk_sources[str_replace('-', '_', $factory->getKey())] = $factory;
176
        }
177
178
        return $this->jwk_sources = $jwk_sources;
179
    }
180
181
    private function createJWKSetSources()
182
    {
@@ 181-200 (lines=20) @@
178
        return $this->jwk_sources = $jwk_sources;
179
    }
180
181
    private function createJWKSetSources()
182
    {
183
        if (null !== $this->jwk_set_sources) {
184
            return $this->jwk_set_sources;
185
        }
186
187
        // load bundled adapter factories
188
        $tempContainer = new ContainerBuilder();
189
        $loader = new XmlFileLoader($tempContainer, new FileLocator(__DIR__.'/../Resources/config'));
190
        $loader->load('jwk_set_sources.xml');
191
192
        $services = $tempContainer->findTaggedServiceIds('jose.jwk_set_source');
193
        $jwk_set_sources = [];
194
        foreach (array_keys($services) as $id) {
195
            $factory = $tempContainer->get($id);
196
            $jwk_set_sources[str_replace('-', '_', $factory->getKeySet())] = $factory;
197
        }
198
199
        return $this->jwk_set_sources = $jwk_set_sources;
200
    }
201
}
202