Code Duplication    Length = 7-7 lines in 2 locations

src/controllers/TicketController.php 2 locations

@@ 186-192 (lines=7) @@
183
                'class' => SmartPerformAction::class,
184
                'scenario' => 'close',
185
                'success' => Yii::t('hipanel:ticket', 'Ticket closed'),
186
                'on beforeSave' => function (Event $event) {
187
                    /** @var Action $action */
188
                    $action = $event->sender;
189
                    foreach ($action->collection->models as $model) {
190
                        $model->{'state'} = Thread::STATE_CLOSE;
191
                    }
192
                },
193
                'POST pjax' => [
194
                    'save' => true,
195
                    'success' => [
@@ 208-214 (lines=7) @@
205
                'class' => SmartPerformAction::class,
206
                'scenario' => 'open',
207
                'success' => Yii::t('hipanel:ticket', 'Ticket opened'),
208
                'on beforeSave' => function (Event $event) {
209
                    /** @var Action $action */
210
                    $action = $event->sender;
211
                    foreach ($action->collection->models as $model) {
212
                        $model->{'state'} = Thread::STATE_OPEN;
213
                    }
214
                },
215
                'POST pjax' => [
216
                    'save' => true,
217
                    'success' => [