Code Duplication    Length = 5-5 lines in 3 locations

src/Controller/Admin/SettingsController.php 3 locations

@@ 77-81 (lines=5) @@
74
            ])
75
            ->first();
76
77
        if (is_null($setting)) {
78
            $this->Flash->error(__d('admin', 'This setting doesn\'t exist or has been deleted.'));
79
80
            return $this->redirect(['action' => 'index']);
81
        }
82
83
        if ($this->request->is(['post', 'put'])) {
84
            $this->Settings->patchEntity($setting, $this->request->getParsedBody());
@@ 113-117 (lines=5) @@
110
            ])
111
            ->first();
112
113
        if (is_null($setting)) {
114
            $this->Flash->error(__d('admin', 'This setting doesn\'t exist or has been deleted.'));
115
116
            return $this->redirect(['action' => 'index']);
117
        }
118
119
        if ($this->Settings->delete($setting)) {
120
            $this->Flash->success(__d('admin', 'This setting has been deleted successfully !'));
@@ 119-123 (lines=5) @@
116
            return $this->redirect(['action' => 'index']);
117
        }
118
119
        if ($this->Settings->delete($setting)) {
120
            $this->Flash->success(__d('admin', 'This setting has been deleted successfully !'));
121
122
            return $this->redirect(['action' => 'index']);
123
        }
124
125
        return $this->redirect(['action' => 'index']);
126
    }