Code Duplication    Length = 12-12 lines in 2 locations

DependencyInjection/SpomkyLabsJoseBundleExtension.php 2 locations

@@ 128-139 (lines=12) @@
125
     * @param \Symfony\Component\DependencyInjection\ContainerBuilder                      $container
126
     * @param \SpomkyLabs\JoseBundle\DependencyInjection\JWKSetSource\JWKSetSourceInterface[] $jwk_set_sources
127
     */
128
    private function createJWKSet($name, array $config, ContainerBuilder $container, array $jwk_set_sources)
129
    {
130
        foreach ($config as $key => $adapter) {
131
            if (array_key_exists($key, $jwk_set_sources)) {
132
                $service_id = sprintf('jose.key_set.%s', $name);
133
                $jwk_set_sources[$key]->create($container, $service_id, $adapter);
134
135
                return;
136
            }
137
        }
138
        throw new \LogicException(sprintf('The JWKSet definition "%s" is not configured.', $name));
139
    }
140
141
    /**
142
     * @param string                                                                    $name
@@ 147-158 (lines=12) @@
144
     * @param \Symfony\Component\DependencyInjection\ContainerBuilder                   $container
145
     * @param \SpomkyLabs\JoseBundle\DependencyInjection\JWKSource\JWKSourceInterface[] $jwk_sources
146
     */
147
    private function createJWK($name, array $config, ContainerBuilder $container, array $jwk_sources)
148
    {
149
        foreach ($config as $key => $adapter) {
150
            if (array_key_exists($key, $jwk_sources)) {
151
                $service_id = sprintf('jose.key.%s', $name);
152
                $jwk_sources[$key]->create($container, $service_id, $adapter);
153
154
                return;
155
            }
156
        }
157
        throw new \LogicException(sprintf('The JWK definition "%s" is not configured.', $name));
158
    }
159
160
    /**
161
     * @param string                                                  $name