Code Duplication    Length = 18-21 lines in 2 locations

src/Controller/Admin/SettingsController.php 1 location

@@ 18-38 (lines=21) @@
15
     *
16
     * @return void
17
     */
18
    public function index()
19
    {
20
        $this->paginate = [
21
            'maxLimit' => 20
22
        ];
23
24
        $settings = $this->Settings
25
            ->find()
26
            ->contain([
27
                'LastUpdatedUser' => function ($q) {
28
                    return $q->find('medium');
29
                }
30
            ])
31
            ->order([
32
                'Settings.name' => 'ASC'
33
            ]);
34
35
        $settings = $this->paginate($settings);
36
37
        $this->set(compact('settings'));
38
    }
39
40
    /**
41
     * Create a setting.

src/Controller/UsersController.php 1 location

@@ 62-79 (lines=18) @@
59
     *
60
     * @return void
61
     */
62
    public function index()
63
    {
64
        $this->paginate = [
65
            'maxLimit' => Configure::read('User.user_per_page')
66
        ];
67
        $users = $this->Users
68
            ->find()
69
            ->contain([
70
                'Groups'
71
            ])
72
            ->order([
73
                'Users.created' => 'desc'
74
            ]);
75
76
        $users = $this->paginate($users);
77
78
        $this->set(compact('users'));
79
    }
80
81
    /**
82
     * Login and register page.