Code Duplication    Length = 28-28 lines in 2 locations

DependencyInjection/Configuration.php 2 locations

@@ 154-181 (lines=28) @@
151
     *
152
     * @return  \Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition
153
     */
154
    private function getPersistersNode()
155
    {
156
        $node = $this->createRootNode('persisters');
157
        return $node
158
            ->isRequired()
159
            ->useAttributeAsKey('name')
160
            ->prototype('array')
161
                ->children()
162
163
                    ->enumNode('type')
164
                        ->values(['mongodb', null])
165
                    ->end()
166
                    ->scalarNode('service')->cannotBeEmpty()->end()
167
168
                    ->arrayNode('parameters')
169
                        ->performNoDeepMerging()
170
                        ->prototype('variable')->end()
171
                    ->end()
172
                ->end()
173
            ->end()
174
            ->validate()
175
                ->always(function($v) {
176
                    $this->validatePersisters($v);
177
                    return $v;
178
                })
179
            ->end()
180
        ;
181
    }
182
183
    /**
184
     * Gets the rest configuration node.
@@ 247-274 (lines=28) @@
244
     *
245
     * @return  \Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition
246
     */
247
    private function getSearchClientsNode()
248
    {
249
        $node = $this->createRootNode('search_clients');
250
        return $node
251
            ->isRequired()
252
            ->useAttributeAsKey('name')
253
            ->prototype('array')
254
                ->children()
255
256
                    ->enumNode('type')
257
                        ->values(['elastic', null])
258
                    ->end()
259
                    ->scalarNode('service')->cannotBeEmpty()->end()
260
261
                    ->arrayNode('parameters')
262
                        ->performNoDeepMerging()
263
                        ->prototype('variable')->end()
264
                    ->end()
265
                ->end()
266
            ->end()
267
            ->validate()
268
                ->always(function($v) {
269
                    $this->validateSearchClients($v);
270
                    return $v;
271
                })
272
            ->end()
273
        ;
274
    }
275
276
    /**
277
     * Validates the api adapter config.