Code Duplication    Length = 3-5 lines in 2 locations

plugins/User/src/Controller/Admin/RolesController.php 1 location

@@ 80-82 (lines=3) @@
77
        $role = $this->Roles->get($id);
78
79
        if ($this->request->data()) {
80
            if (empty($this->request->data['regenerate_slug'])) {
81
                $this->Roles->behaviors()->Sluggable->config(['on' => 'create']);
82
            }
83
84
            $role = $this->Roles->patchEntity($role, $this->request->data(), ['fieldList' => 'name']);
85
            if ($this->Roles->save($role)) {

plugins/Content/src/Controller/Admin/ManageController.php 1 location

@@ 215-219 (lines=5) @@
212
        }
213
214
        if (!empty($this->request->data)) {
215
            if (empty($this->request->data['regenerate_slug'])) {
216
                $this->Contents->behaviors()->Sluggable->config(['on' => 'create']);
217
            } else {
218
                unset($this->request->data['regenerate_slug']);
219
            }
220
221
            $content->accessible([
222
                'id',