Code Duplication    Length = 14-14 lines in 2 locations

Event/Subscriber/ExtraConfigurationSubscriber.php 2 locations

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