Code Duplication    Length = 14-14 lines in 2 locations

src/LAG/AdminBundle/Event/Subscriber/ExtraConfigurationSubscriber.php 2 locations

@@ 262-275 (lines=14) @@
259
                ->getParameter('translation')['pattern'];
260
261
            // add a link to the "edit" action, if it is allowed
262
            if (in_array('edit', $allowedActions)) {
263
                $configuration['fields']['_actions']['type'] = 'collection';
264
                $configuration['fields']['_actions']['options']['_edit'] = [
265
                    'type' => 'action',
266
                    'options' => [
267
                        'title' => $this->getTranslationKey($translationPattern, 'edit', $event->getAdmin()->getName()),
268
                        'route' => $event->getAdmin()->generateRouteName('edit'),
269
                        'parameters' => [
270
                            'id' => false
271
                        ],
272
                        'icon' => 'pencil'
273
                    ]
274
                ];
275
            }
276
            // add a link to the "delete" action, if it is allowed
277
            if (in_array('delete', $allowedActions)) {
278
                $configuration['fields']['_actions']['type'] = 'collection';
@@ 277-290 (lines=14) @@
274
                ];
275
            }
276
            // add a link to the "delete" action, if it is allowed
277
            if (in_array('delete', $allowedActions)) {
278
                $configuration['fields']['_actions']['type'] = 'collection';
279
                $configuration['fields']['_actions']['options']['_delete'] = [
280
                    'type' => 'action',
281
                    'options' => [
282
                        'title' => $this->getTranslationKey($translationPattern, 'delete', $event->getAdmin()->getName()),
283
                        'route' => $event->getAdmin()->generateRouteName('delete'),
284
                        'parameters' => [
285
                            'id' => false
286
                        ],
287
                        'icon' => 'remove'
288
                    ]
289
                ];
290
            }
291
        }
292
    }
293
}