Code Duplication    Length = 7-8 lines in 3 locations

src/plugins/onTick/authCheck.php 3 locations

@@ 146-152 (lines=7) @@
143
        $allianceArray = array();
144
145
        // If config is outdated
146
        if (null === $this->authGroups) {
147
            $msg = '**Auth Failure:** Please update the bots config to the latest version.';
148
            queueMessage($msg, $this->alertChannel, $this->guild);
149
            $nextCheck = time() + 10800;
150
            setPermCache('permsLastChecked', $nextCheck);
151
            return null;
152
        }
153
154
        //Set corp/ally id arrays
155
        foreach ($this->authGroups as $authGroup) {
@@ 218-225 (lines=8) @@
215
        }
216
217
        // If config is outdated
218
        if (null === $this->authGroups) {
219
            $msg = '**Auth Failure:** Please update the bots config to the latest version.';
220
            queueMessage($msg, $this->alertChannel, $this->guild);
221
            //queue up next check
222
            $nextCheck = time() + 1800;
223
            setPermCache('authStateLastChecked', $nextCheck);
224
            return null;
225
        }
226
227
        //Establish connection to mysql
228
        $conn = new mysqli($this->db, $this->dbUser, $this->dbPass, $this->dbName);
@@ 312-318 (lines=7) @@
309
        $result = $conn->query($sql);
310
311
        // If config is outdated
312
        if (null === $this->authGroups) {
313
            $msg = '**Auth Failure:** Please update the bots config to the latest version.';
314
            queueMessage($msg, $this->alertChannel, $this->guild);
315
            $nextCheck = time() + 1800;
316
            setPermCache('nextRename', $nextCheck);
317
            return null;
318
        }
319
320
        if (@$result->num_rows >= 1) {
321
            while ($rows = $result->fetch_assoc()) {