Code Duplication    Length = 17-18 lines in 2 locations

DependencyInjection/CrudsEntitiesConfigurator.php 2 locations

@@ 111-127 (lines=17) @@
108
        $this->registerRoute($mount, $name, $actionName, $path, $action, ['POST'], ['class' => $class]);
109
    }
110
111
    public function registerReadAction($mount, $name, $path, $repository, $class)
112
    {
113
        $definition = new Definition(ReadController::class);
114
        $definition->setArguments(
115
            [
116
                $repository,
117
                $this->getEvm(),
118
            ]
119
        );
120
121
        $actionName   = 'read';
122
        $controllerId = $this->generateControllerId($name, $actionName);
123
        $this->container->setDefinition($controllerId, $definition);
124
125
        $action = $controllerId.':'.ReadController::ACTION;
126
        $this->registerRoute($mount, $name, $actionName, $path, $action, ['GET', 'POST'], ['class' => $class]);
127
    }
128
129
    public function registerUpdateAction($mount, $name, $path, $repository, $processor, $manager, $class)
130
    {
@@ 155-172 (lines=18) @@
152
        $this->registerRoute($mount, $name, $actionName, $path, $action, ['POST'], ['class' => $class]);
153
    }
154
155
    public function registerDeleteAction($mount, $name, $path, $repository, $manager, $class)
156
    {
157
        $definition = new Definition(DeleteController::class);
158
        $definition->setArguments(
159
            [
160
                $repository,
161
                $manager,
162
                $this->getEvm(),
163
            ]
164
        );
165
166
        $actionName   = 'delete';
167
        $controllerId = $controllerId = $this->generateControllerId($name, $actionName);
168
        $this->container->setDefinition($controllerId, $definition);
169
170
        $action = $controllerId.':'.DeleteController::ACTION;
171
        $this->registerRoute($mount, $name, $actionName, $path, $action, ['POST'], ['class' => $class]);
172
    }
173
174
    public function registerSearchAction($mount, $name, $path, $class, $repository, array $criteria = [])
175
    {