Code Duplication    Length = 7-7 lines in 2 locations

src/controllers/TicketController.php 2 locations

@@ 161-167 (lines=7) @@
158
                'class' => SmartPerformAction::class,
159
                'scenario' => 'close',
160
                'success' => Yii::t('hipanel:ticket', 'Ticket closed'),
161
                'on beforeSave' => function (Event $event) {
162
                    /** @var Action $action */
163
                    $action = $event->sender;
164
                    foreach ($action->collection->models as $model) {
165
                        $model->{'state'} = Thread::STATE_CLOSE;
166
                    }
167
                },
168
                'POST pjax' => [
169
                    'save' => true,
170
                    'success' => [
@@ 183-189 (lines=7) @@
180
                'class' => SmartPerformAction::class,
181
                'scenario' => 'open',
182
                'success' => Yii::t('hipanel:ticket', 'Ticket opened'),
183
                'on beforeSave' => function (Event $event) {
184
                    /** @var Action $action */
185
                    $action = $event->sender;
186
                    foreach ($action->collection->models as $model) {
187
                        $model->{'state'} = Thread::STATE_OPEN;
188
                    }
189
                },
190
                'POST pjax' => [
191
                    'save' => true,
192
                    'success' => [