Code Duplication    Length = 14-14 lines in 2 locations

Event/Subscriber/ExtraConfigurationSubscriber.php 2 locations

@@ 149-162 (lines=14) @@
146
        ) {
147
            // in list view, we add by default and an edit and a delete button
148
            if ($event->getActionName() == 'list') {
149
                if (in_array('edit', $allowedActions)) {
150
                    $configuration['fields']['_actions']['type'] = 'collection';
151
                    $configuration['fields']['_actions']['options']['_edit'] = [
152
                        'type' => 'action',
153
                        'options' => [
154
                            'title' => $this->applicationConfiguration->getTranslationKey('edit', $event->getAdmin()->getName()),
155
                            'route' => $admin->generateRouteName('edit'),
156
                            'parameters' => [
157
                                'id' => false
158
                            ],
159
                            'icon' => 'pencil'
160
                        ]
161
                    ];
162
                }
163
                if (in_array('delete', $allowedActions)) {
164
                    $configuration['fields']['_actions']['type'] = 'collection';
165
                    $configuration['fields']['_actions']['options']['_delete'] = [
@@ 163-176 (lines=14) @@
160
                        ]
161
                    ];
162
                }
163
                if (in_array('delete', $allowedActions)) {
164
                    $configuration['fields']['_actions']['type'] = 'collection';
165
                    $configuration['fields']['_actions']['options']['_delete'] = [
166
                        'type' => 'action',
167
                        'options' => [
168
                            'title' => $this->applicationConfiguration->getTranslationKey('delete', $event->getAdmin()->getName()),
169
                            'route' => $admin->generateRouteName('delete'),
170
                            'parameters' => [
171
                                'id' => false
172
                            ],
173
                            'icon' => 'remove'
174
                        ]
175
                    ];
176
                }
177
            }
178
        }
179
        // add default menu actions if none was provided