Code Duplication    Length = 12-12 lines in 2 locations

DependencyInjection/SpomkyLabsJoseBundleExtension.php 2 locations

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