Code Duplication    Length = 14-14 lines in 2 locations

Event/Subscriber/ExtraConfigurationSubscriber.php 2 locations

@@ 167-180 (lines=14) @@
164
                ->getParameter('translation')['pattern'];
165
166
            // add a link to the "edit" action, if it is allowed
167
            if (in_array('edit', $allowedActions)) {
168
                $configuration['fields']['_actions']['type'] = 'collection';
169
                $configuration['fields']['_actions']['options']['_edit'] = [
170
                    'type' => 'action',
171
                    'options' => [
172
                        'title' => $this->getTranslationKey($translationPattern, 'edit', $event->getAdmin()->getName()),
173
                        'route' => $admin->generateRouteName('edit'),
174
                        'parameters' => [
175
                            'id' => false
176
                        ],
177
                        'icon' => 'pencil'
178
                    ]
179
                ];
180
            }
181
            // add a link to the "delete" action, if it is allowed
182
            if (in_array('delete', $allowedActions)) {
183
                $configuration['fields']['_actions']['type'] = 'collection';
@@ 182-195 (lines=14) @@
179
                ];
180
            }
181
            // add a link to the "delete" action, if it is allowed
182
            if (in_array('delete', $allowedActions)) {
183
                $configuration['fields']['_actions']['type'] = 'collection';
184
                $configuration['fields']['_actions']['options']['_delete'] = [
185
                    'type' => 'action',
186
                    'options' => [
187
                        'title' => $this->getTranslationKey($translationPattern, 'delete', $event->getAdmin()->getName()),
188
                        'route' => $admin->generateRouteName('delete'),
189
                        'parameters' => [
190
                            'id' => false
191
                        ],
192
                        'icon' => 'remove'
193
                    ]
194
                ];
195
            }
196
        }
197
        // reset action configuration
198
        $event->setConfiguration($configuration);