Code Duplication    Length = 8-8 lines in 4 locations

src/plugins/onTick/siloFull.php 1 location

@@ 567-574 (lines=8) @@
564
        $cached = $xml->cachedUntil[0];
565
        $baseUnix = strtotime($cached);
566
        $cacheClr = $baseUnix - 13500;
567
        if ($cacheClr <= time()) {
568
            $weirdTime = time() + 21700;
569
            $cacheTimer = gmdate("Y-m-d H:i:s", $weirdTime);
570
            setPermCache("siloLastChecked{$keyID}", $weirdTime);
571
        } else {
572
            $cacheTimer = gmdate("Y-m-d H:i:s", $cacheClr);
573
            setPermCache("siloLastChecked{$keyID}", $cacheClr);
574
        }
575
576
        if ($siloCount > 0) {
577
            $msg = "Next Silo Check At: {$cacheTimer} EVE Time";

src/plugins/onTick/evemails.php 1 location

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

src/plugins/onTick/notifications.php 1 location

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

src/plugins/onTick/siphons.php 1 location

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