Code Duplication    Length = 8-8 lines in 4 locations

src/plugins/onTick/evemails.php 1 location

@@ 134-141 (lines=8) @@
131
        $cached = $xml->cachedUntil[0];
132
        $baseUnix = strtotime($cached);
133
        $cacheClr = $baseUnix - 13500;
134
        if ($cacheClr <= time()) {
135
            $weirdTime = time() + 1830;
136
            $cacheTimer = gmdate("Y-m-d H:i:s", $weirdTime);
137
            setPermCache("mailLastChecked{$keyID}", $weirdTime);
138
        } else {
139
            $cacheTimer = gmdate("Y-m-d H:i:s", $cacheClr);
140
            setPermCache("mailLastChecked{$keyID}", $cacheClr);
141
        }
142
143
        $mails = array();
144
        if (isset($data["@attributes"])) { $mails[] = $data["@attributes"]; }

src/plugins/onTick/notifications.php 1 location

@@ 153-160 (lines=8) @@
150
            if (!isset($this->fuelChannel)) {
151
                $this->fuelChannel = $this->toDiscordChannel;
152
            }
153
            if ($cacheClr <= time()) {
154
                $weirdTime = time() + 1830;
155
                $cacheTimer = gmdate("Y-m-d H:i:s", $weirdTime);
156
                setPermCache("notificationsLastChecked{$keyID}", $weirdTime);
157
            } else {
158
                $cacheTimer = gmdate("Y-m-d H:i:s", $cacheClr);
159
                setPermCache("notificationsLastChecked{$keyID}", $cacheClr);
160
            }
161
            $data = json_decode(json_encode(simplexml_load_string(downloadData($url),
162
                "SimpleXMLElement", LIBXML_NOCDATA)), true);
163
            $data = $data["result"]["rowset"]["row"];

src/plugins/onTick/siloFull.php 1 location

@@ 623-630 (lines=8) @@
620
        $cached = $xml->cachedUntil[0];
621
        $baseUnix = strtotime($cached);
622
        $cacheClr = $baseUnix - 13500;
623
        if ($cacheClr <= time()) {
624
            $weirdTime = time() + 21700;
625
            $cacheTimer = gmdate("Y-m-d H:i:s", $weirdTime);
626
            setPermCache("siloLastChecked{$keyID}", $weirdTime);
627
        } else {
628
            $cacheTimer = gmdate("Y-m-d H:i:s", $cacheClr);
629
            setPermCache("siloLastChecked{$keyID}", $cacheClr);
630
        }
631
632
        if ($siloCount > 0) {
633
            $msg = "Next Silo Check At: {$cacheTimer} EVE Time";

src/plugins/onTick/siphons.php 1 location

@@ 153-160 (lines=8) @@
150
        $cached = $xml->cachedUntil[0];
151
        $baseUnix = strtotime($cached);
152
        $cacheClr = $baseUnix - 13500;
153
        if ($cacheClr <= time()) {
154
            $weirdTime = time() + 21700;
155
            $cacheTimer = gmdate("Y-m-d H:i:s", $weirdTime);
156
            setPermCache("siphonLastChecked{$keyID}", $weirdTime);
157
        } else {
158
            $cacheTimer = gmdate("Y-m-d H:i:s", $cacheClr);
159
            setPermCache("siphonLastChecked{$keyID}", $cacheClr);
160
        }
161
        if ($siphonCount > 0) {
162
            $msg = "Next Siphon Check At: {$cacheTimer} EVE Time";
163
            $channelID = $this->toDiscordChannel;