Code Duplication    Length = 26-26 lines in 2 locations

DependencyInjection/Configuration.php 2 locations

@@ 139-164 (lines=26) @@
136
     *
137
     * @return  \Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition
138
     */
139
    private function getPersistersNode()
140
    {
141
        $treeBuilder = new TreeBuilder();
142
        $node = $treeBuilder->root('persisters');
143
        return $node
144
            ->isRequired()
145
            ->useAttributeAsKey('name')
146
            ->prototype('array')
147
                ->children()
148
149
                    ->scalarNode('type')->cannotBeEmpty()->end()
150
                    ->scalarNode('service')->cannotBeEmpty()->end()
151
152
                    ->arrayNode('parameters')
153
                        ->prototype('variable')->end()
154
                    ->end()
155
                ->end()
156
            ->end()
157
            ->validate()
158
                ->always(function($v) {
159
                    $this->validatePersisters($v);
160
                    return $v;
161
                })
162
            ->end()
163
        ;
164
    }
165
166
    /**
167
     * Gets the rest configuration node.
@@ 196-221 (lines=26) @@
193
     *
194
     * @return  \Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition
195
     */
196
    private function getSearchClientsNode()
197
    {
198
        $treeBuilder = new TreeBuilder();
199
        $node = $treeBuilder->root('search_clients');
200
        return $node
201
            ->isRequired()
202
            ->useAttributeAsKey('name')
203
            ->prototype('array')
204
                ->children()
205
206
                    ->scalarNode('type')->cannotBeEmpty()->end()
207
                    ->scalarNode('service')->cannotBeEmpty()->end()
208
209
                    ->arrayNode('parameters')
210
                        ->prototype('variable')->end()
211
                    ->end()
212
                ->end()
213
            ->end()
214
            ->validate()
215
                ->always(function($v) {
216
                    $this->validateSearchClients($v);
217
                    return $v;
218
                })
219
            ->end()
220
        ;
221
    }
222
223
    /**
224
     * Validates the api adapter config.