Code Duplication    Length = 7-7 lines in 2 locations

src/controllers/TicketController.php 2 locations

@@ 170-176 (lines=7) @@
167
                'class' => SmartPerformAction::class,
168
                'scenario' => 'close',
169
                'success' => Yii::t('hipanel/ticket', 'Ticket closed'),
170
                'on beforeSave' => function (Event $event) {
171
                    /** @var Action $action */
172
                    $action = $event->sender;
173
                    foreach ($action->collection->models as $model) {
174
                        $model->{'state'} = Thread::STATE_CLOSE;
175
                    }
176
                },
177
                'POST pjax' => [
178
                    'save' => true,
179
                    'success' => [
@@ 192-198 (lines=7) @@
189
                'class' => SmartPerformAction::class,
190
                'scenario' => 'open',
191
                'success' => Yii::t('hipanel/ticket', 'Ticket opened'),
192
                'on beforeSave' => function (Event $event) {
193
                    /** @var Action $action */
194
                    $action = $event->sender;
195
                    foreach ($action->collection->models as $model) {
196
                        $model->{'state'} = Thread::STATE_OPEN;
197
                    }
198
                },
199
                'POST pjax' => [
200
                    'save' => true,
201
                    'success' => [