Code Duplication    Length = 5-5 lines in 3 locations

src/actions/SmartCreateAction.php 1 location

@@ 86-90 (lines=5) @@
83
                'save'    => true,
84
                'success' => [
85
                    'class' => RedirectAction::class,
86
                    'url'   => function ($action) {
87
                        return $action->collection->count() > 1
88
                            ? $action->controller->getSearchUrl()
89
                            : $action->controller->getActionUrl('view', ['id' => $action->model->id]);
90
                    },
91
                ],
92
                'error'   => [
93
                    'class'  => RenderAction::class,

src/actions/SmartUpdateAction.php 2 locations

@@ 155-159 (lines=5) @@
152
                'save'    => true,
153
                'success' => [
154
                    'class' => RedirectAction::class,
155
                    'url'   => function ($action) {
156
                        return $action->collection->count() > 1
157
                            ? $action->controller->getSearchUrl()
158
                            : $action->controller->getActionUrl('view', ['id' => $action->collection->first->id]);
159
                    },
160
                ],
161
                'error'   => [
162
                    'class'  => RenderAction::class,
@@ 202-206 (lines=5) @@
199
                'save'    => true,
200
                'success' => [
201
                    'class' => RedirectAction::class,
202
                    'url'   => function ($action) {
203
                        return $action->collection->count() > 1
204
                            ? $action->controller->getSearchUrl()
205
                            : $action->controller->getActionUrl('view', ['id' => $action->collection->first->id]);
206
                    },
207
                ],
208
            ],
209
        ]);