Code Duplication    Length = 12-12 lines in 2 locations

DependencyInjection/SpomkyLabsJoseBundleExtension.php 2 locations

@@ 114-125 (lines=12) @@
111
     * @param \Symfony\Component\DependencyInjection\ContainerBuilder                      $container
112
     * @param \SpomkyLabs\JoseBundle\DependencyInjection\JWKSetSource\JWKSetSourceInterface[] $jwk_set_sources
113
     */
114
    private function createJWKSet($name, array $config, ContainerBuilder $container, array $jwk_set_sources)
115
    {
116
        foreach ($config as $key => $adapter) {
117
            if (array_key_exists($key, $jwk_set_sources)) {
118
                $service_id = sprintf('jose.key_set.%s', $name);
119
                $jwk_set_sources[$key]->create($container, $service_id, $adapter);
120
121
                return;
122
            }
123
        }
124
        throw new \LogicException(sprintf('The JWKSet definition "%s" is not configured.', $name));
125
    }
126
127
    /**
128
     * @param string                                                                    $name
@@ 133-144 (lines=12) @@
130
     * @param \Symfony\Component\DependencyInjection\ContainerBuilder                   $container
131
     * @param \SpomkyLabs\JoseBundle\DependencyInjection\JWKSource\JWKSourceInterface[] $jwk_sources
132
     */
133
    private function createJWK($name, array $config, ContainerBuilder $container, array $jwk_sources)
134
    {
135
        foreach ($config as $key => $adapter) {
136
            if (array_key_exists($key, $jwk_sources)) {
137
                $service_id = sprintf('jose.key.%s', $name);
138
                $jwk_sources[$key]->create($container, $service_id, $adapter);
139
140
                return;
141
            }
142
        }
143
        throw new \LogicException(sprintf('The JWK definition "%s" is not configured.', $name));
144
    }
145
146
    /**
147
     * @return string[]