Code Duplication    Length = 5-5 lines in 3 locations

src/actions/SmartUpdateAction.php 2 locations

@@ 147-151 (lines=5) @@
144
                'save'    => true,
145
                'success' => [
146
                    'class' => RedirectAction::class,
147
                    'url'   => function ($action) {
148
                        return $action->collection->count() > 1
149
                            ? $action->controller->getSearchUrl(['id_in' => $action->collection->ids])
150
                            : $action->controller->getActionUrl('view', ['id' => $action->collection->first->id]);
151
                    },
152
                ],
153
                'error'   => [
154
                    'class'  => RenderAction::class,
@@ 179-183 (lines=5) @@
176
                'save'    => true,
177
                'success' => [
178
                    'class' => RedirectAction::class,
179
                    'url'   => function ($action) {
180
                        return $action->collection->count() > 1
181
                            ? $action->controller->getSearchUrl(['id_in' => $action->collection->ids])
182
                            : $action->controller->getActionUrl('view', ['id' => $action->collection->first->id]);
183
                    },
184
                ],
185
            ],
186
        ]);

src/actions/SmartCreateAction.php 1 location

@@ 62-66 (lines=5) @@
59
                'save'    => true,
60
                'success' => [
61
                    'class' => RedirectAction::class,
62
                    'url'   => function ($action) {
63
                        return $action->collection->count() > 1
64
                            ? $action->controller->getSearchUrl(['id_in' => $action->collection->ids])
65
                            : $action->controller->getActionUrl('view', ['id' => $action->model->id]);
66
                    },
67
                ],
68
                'error'   => [
69
                    'class'  => RenderAction::class,