Code Duplication    Length = 27-27 lines in 2 locations

DependencyInjection/Configuration.php 2 locations

@@ 151-177 (lines=27) @@
148
     *
149
     * @return  \Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition
150
     */
151
    private function getPersistersNode()
152
    {
153
        $node = $this->createRootNode('persisters');
154
        return $node
155
            ->isRequired()
156
            ->useAttributeAsKey('name')
157
            ->prototype('array')
158
                ->children()
159
160
                    ->enumNode('type')
161
                        ->values(['mongodb', null])
162
                    ->end()
163
                    ->scalarNode('service')->cannotBeEmpty()->end()
164
165
                    ->arrayNode('parameters')
166
                        ->prototype('variable')->end()
167
                    ->end()
168
                ->end()
169
            ->end()
170
            ->validate()
171
                ->always(function($v) {
172
                    $this->validatePersisters($v);
173
                    return $v;
174
                })
175
            ->end()
176
        ;
177
    }
178
179
    /**
180
     * Gets the rest configuration node.
@@ 208-234 (lines=27) @@
205
     *
206
     * @return  \Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition
207
     */
208
    private function getSearchClientsNode()
209
    {
210
        $node = $this->createRootNode('search_clients');
211
        return $node
212
            ->isRequired()
213
            ->useAttributeAsKey('name')
214
            ->prototype('array')
215
                ->children()
216
217
                    ->enumNode('type')
218
                        ->values(['elastic', null])
219
                    ->end()
220
                    ->scalarNode('service')->cannotBeEmpty()->end()
221
222
                    ->arrayNode('parameters')
223
                        ->prototype('variable')->end()
224
                    ->end()
225
                ->end()
226
            ->end()
227
            ->validate()
228
                ->always(function($v) {
229
                    $this->validateSearchClients($v);
230
                    return $v;
231
                })
232
            ->end()
233
        ;
234
    }
235
236
    /**
237
     * Validates the api adapter config.