Code Duplication    Length = 25-26 lines in 2 locations

DependencyInjection/CrudsEntitiesConfigurator.php 2 locations

@@ 204-228 (lines=25) @@
201
        return $this->container->getDefinition('cruds.api.router_loader');
202
    }
203
204
    public function registerReadAction($mount, $name, $path, $repository, $class)
205
    {
206
        $definition = new Definition(ReadController::class);
207
        $definition->setArguments(
208
            [
209
                $repository,
210
                $this->getEvm(),
211
            ]
212
        );
213
214
        $actionName   = 'read';
215
        $controllerId = $this->generateControllerId($name, $actionName);
216
        $this->container->setDefinition($controllerId, $definition);
217
218
        $action = $controllerId . ':' . ReadController::ACTION;
219
        $this->registerRoute(
220
            $mount,
221
            $name,
222
            $actionName,
223
            $path,
224
            $action,
225
            ['GET', 'POST'],
226
            ['class' => $class, 'arguments' => ['identifier']]
227
        );
228
    }
229
230
    public function registerUpdateAction($mount, $name, $path, $repository, $processor, $manager, $class)
231
    {
@@ 264-289 (lines=26) @@
261
        );
262
    }
263
264
    public function registerDeleteAction($mount, $name, $path, $repository, $manager, $class)
265
    {
266
        $definition = new Definition(DeleteController::class);
267
        $definition->setArguments(
268
            [
269
                $repository,
270
                $manager,
271
                $this->getEvm(),
272
            ]
273
        );
274
275
        $actionName   = 'delete';
276
        $controllerId = $controllerId = $this->generateControllerId($name, $actionName);
277
        $this->container->setDefinition($controllerId, $definition);
278
279
        $action = $controllerId . ':' . DeleteController::ACTION;
280
        $this->registerRoute(
281
            $mount,
282
            $name,
283
            $actionName,
284
            $path,
285
            $action,
286
            ['POST', 'DELETE'],
287
            ['class' => $class, 'arguments' => ['identifier']]
288
        );
289
    }
290
291
    public function registerSearchAction($mount, $name, $path, $class, $repository, $criteria, $count_path, $prefix)
292
    {