Code Duplication    Length = 7-8 lines in 3 locations

src/plugins/onTick/authCheck.php 3 locations

@@ 157-163 (lines=7) @@
154
        $allianceArray = array();
155
156
        // If config is outdated
157
        if (null === $this->authGroups) {
158
            $msg = '**Auth Failure:** Please update the bots config to the latest version.';
159
            queueMessage($msg, $this->alertChannel, $this->guild);
160
            $nextCheck = time() + 10800;
161
            setPermCache('permsLastChecked', $nextCheck);
162
            return null;
163
        }
164
165
        //Set corp/ally id arrays
166
        foreach ($this->authGroups as $authGroup) {
@@ 257-264 (lines=8) @@
254
        }
255
256
        // If config is outdated
257
        if (null === $this->authGroups) {
258
            $msg = '**Auth Failure:** Please update the bots config to the latest version.';
259
            queueMessage($msg, $this->alertChannel, $this->guild);
260
            //queue up next check
261
            $nextCheck = time() + 1800;
262
            setPermCache('authStateLastChecked', $nextCheck);
263
            return null;
264
        }
265
266
        //Establish connection to mysql
267
        $conn = new mysqli($this->db, $this->dbUser, $this->dbPass, $this->dbName);
@@ 351-357 (lines=7) @@
348
        $result = $conn->query($sql);
349
350
        // If config is outdated
351
        if (null === $this->authGroups) {
352
            $msg = '**Auth Failure:** Please update the bots config to the latest version.';
353
            queueMessage($msg, $this->alertChannel, $this->guild);
354
            $nextCheck = time() + 1800;
355
            setPermCache('nextRename', $nextCheck);
356
            return null;
357
        }
358
359
        if (@$result->num_rows >= 1) {
360
            while ($rows = $result->fetch_assoc()) {