@@ -112,7 +112,7 @@ |
||
112 | 112 | $cacheClr = $baseUnix - 13500; |
113 | 113 | |
114 | 114 | //Set timer for next key based on number of keys |
115 | - $nextKey = (1900 / (int)$this->numberOfKeys) + time(); |
|
115 | + $nextKey = (1900 / (int) $this->numberOfKeys) + time(); |
|
116 | 116 | $nextKeyTime = gmdate('Y-m-d H:i:s', $nextKey); |
117 | 117 | setPermCache('mailLastChecked', $nextKey); |
118 | 118 |
@@ -125,7 +125,7 @@ |
||
125 | 125 | $this->fuelChannel = $this->toDiscordChannel; |
126 | 126 | } |
127 | 127 | //Set timer for next key based on number of keys |
128 | - $nextKey = (1900 / (int)$this->numberOfKeys) + time(); |
|
128 | + $nextKey = (1900 / (int) $this->numberOfKeys) + time(); |
|
129 | 129 | $nextKeyTime = gmdate('Y-m-d H:i:s', $nextKey); |
130 | 130 | setPermCache('notificationsLastChecked', $nextKey); |
131 | 131 | //Set cache timer for api key |
@@ -71,7 +71,7 @@ |
||
71 | 71 | $roles = $member->roles; |
72 | 72 | foreach ($roles as $role) { |
73 | 73 | if (in_array(strtolower($role->name), $adminRoles, true)) { |
74 | - $avatarURL = strtolower((string)$data['messageString']); |
|
74 | + $avatarURL = strtolower((string) $data['messageString']); |
|
75 | 75 | $ch = curl_init($avatarURL); |
76 | 76 | if (substr($avatarURL, -4) === '.jpg') { |
77 | 77 | $fp = fopen('/tmp/avatar.jpg', 'wb'); |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | GLOBAL $logger; |
56 | 56 | |
57 | 57 | //Check we are not running on a 32bit platform |
58 | -if(PHP_INT_SIZE == 4) |
|
58 | +if (PHP_INT_SIZE == 4) |
|
59 | 59 | { |
60 | 60 | $logger->error('32bit PHP found, if you are running a 64bit OS please install 64bit PHP'); |
61 | 61 | die(); |
@@ -206,7 +206,7 @@ discard block |
||
206 | 206 | clearQueuedMessages($id); |
207 | 207 | continue; |
208 | 208 | } |
209 | - $channel = $guild->channels->get('id', (int)$queuedMessage['channel']); |
|
209 | + $channel = $guild->channels->get('id', (int) $queuedMessage['channel']); |
|
210 | 210 | //Check if channel is bad |
211 | 211 | if (null === $channel) { |
212 | 212 | $logger->addInfo("QueueProcessing Error- Item #{$id} : Channel provided is incorrect, removing it from the queue"); |
@@ -91,7 +91,7 @@ |
||
91 | 91 | } |
92 | 92 | |
93 | 93 | $rss = new SimpleXMLElement($rssUrl, null, true); // XML parser |
94 | - if ($rss===null || !is_object($rss)) { |
|
94 | + if ($rss === null || !is_object($rss)) { |
|
95 | 95 | $this->logger->addInfo("Failed to load xml file: {$rssUrl}"); |
96 | 96 | break; |
97 | 97 | } |
@@ -93,16 +93,16 @@ discard block |
||
93 | 93 | if ($kmGroup['startMail'] > $SavedKillID || null === $SavedKillID) { |
94 | 94 | $SavedKillID = $kmGroup['startMail']; |
95 | 95 | } |
96 | - if ((string)$kmGroup['allianceID'] === '0' & $kmGroup['lossMails'] === 'true') { |
|
96 | + if ((string) $kmGroup['allianceID'] === '0' & $kmGroup['lossMails'] === 'true') { |
|
97 | 97 | $url = "https://zkillboard.com/api/corporationID/{$kmGroup['corpID']}/no-attackers/no-items/orderDirection/asc/pastSeconds/10800/"; |
98 | 98 | } |
99 | - if ((string)$kmGroup['allianceID'] === '0' & $kmGroup['lossMails'] === 'false') { |
|
99 | + if ((string) $kmGroup['allianceID'] === '0' & $kmGroup['lossMails'] === 'false') { |
|
100 | 100 | $url = "https://zkillboard.com/api/corporationID/{$kmGroup['corpID']}/no-attackers/no-items/kills/orderDirection/asc/pastSeconds/10800/"; |
101 | 101 | } |
102 | - if ((string)$kmGroup['allianceID'] !== '0' & $kmGroup['lossMails'] === 'true') { |
|
102 | + if ((string) $kmGroup['allianceID'] !== '0' & $kmGroup['lossMails'] === 'true') { |
|
103 | 103 | $url = "https://zkillboard.com/api/allianceID/{$kmGroup['allianceID']}/no-attackers/no-items/orderDirection/asc/pastSeconds/10800/"; |
104 | 104 | } |
105 | - if ((string)$kmGroup['allianceID'] !== '0' & $kmGroup['lossMails'] === 'false') { |
|
105 | + if ((string) $kmGroup['allianceID'] !== '0' & $kmGroup['lossMails'] === 'false') { |
|
106 | 106 | $url = "https://zkillboard.com/api/allianceID/{$kmGroup['allianceID']}/no-attackers/no-items/kills/orderDirection/asc/pastSeconds/10800/"; |
107 | 107 | } |
108 | 108 | |
@@ -204,7 +204,7 @@ discard block |
||
204 | 204 | // if ($i < 10) { |
205 | 205 | $killID = $kill['killID']; |
206 | 206 | //check if mail is old |
207 | - if ((int)$killID <= (int)$oldID) { |
|
207 | + if ((int) $killID <= (int) $oldID) { |
|
208 | 208 | continue; |
209 | 209 | } |
210 | 210 | //save highest killID for cache |
@@ -245,13 +245,13 @@ discard block |
||
245 | 245 | $corporationDetails = $this->getCorpDetails($character['corporation_id']); |
246 | 246 | $allianceContacts = getContacts($corporationDetails['alliance_id']); |
247 | 247 | $corpContacts = getContacts($character['corporation_id']); |
248 | - if ($role === 'blue' && ((int)$allianceContacts['standing'] === 5 || 10 || (int)$corpContacts['standing'] === 5 || 10)) { |
|
248 | + if ($role === 'blue' && ((int) $allianceContacts['standing'] === 5 || 10 || (int) $corpContacts['standing'] === 5 || 10)) { |
|
249 | 249 | $return = true; |
250 | 250 | } |
251 | - if ($role === 'red' && ((int)$allianceContacts['standing'] === -5 || -10 || (int)$corpContacts['standing'] === -5 || -10)) { |
|
251 | + if ($role === 'red' && ((int) $allianceContacts['standing'] === -5 || -10 || (int) $corpContacts['standing'] === -5 || -10)) { |
|
252 | 252 | $return = true; |
253 | 253 | } |
254 | - if ($role === 'neut' && ((int)$allianceContacts['standing'] === 0 || (int)$corpContacts['standing'] === 0 || (@(int)$allianceContacts['standings'] === null || '' && @(int)$corpContacts['standings'] === null || ''))) { |
|
254 | + if ($role === 'neut' && ((int) $allianceContacts['standing'] === 0 || (int) $corpContacts['standing'] === 0 || (@(int) $allianceContacts['standings'] === null || '' && @(int) $corpContacts['standings'] === null || ''))) { |
|
255 | 255 | $return = true; |
256 | 256 | } |
257 | 257 | } |
@@ -329,14 +329,14 @@ discard block |
||
329 | 329 | private function standingsUpdate() |
330 | 330 | { |
331 | 331 | foreach ($this->apiKey as $apiKey) { |
332 | - if ((string)$apiKey['keyID'] === (string)$this->config['plugins']['auth']['standings']['apiKey']) { |
|
332 | + if ((string) $apiKey['keyID'] === (string) $this->config['plugins']['auth']['standings']['apiKey']) { |
|
333 | 333 | $url = "https://api.eveonline.com/char/ContactList.xml.aspx?keyID={$apiKey['keyID']}&vCode={$apiKey['vCode']}&characterID={$apiKey['characterID']}"; |
334 | 334 | $xml = makeApiRequest($url); |
335 | 335 | if (empty($xml)) { |
336 | 336 | return null; |
337 | 337 | } |
338 | 338 | foreach ($xml->result->rowset as $contactType) { |
339 | - if ((string)$contactType->attributes()->name === 'corporateContactList' || 'allianceContactList') { |
|
339 | + if ((string) $contactType->attributes()->name === 'corporateContactList' || 'allianceContactList') { |
|
340 | 340 | foreach ($contactType->row as $contact) { |
341 | 341 | if (null !== $contact['contactID'] && $contact['contactName'] && $contact['standing']) { |
342 | 342 | addContactInfo($contact['contactID'], $contact['contactName'], $contact['standing']); |
@@ -132,12 +132,12 @@ |
||
132 | 132 | $data = new SimpleXMLElement(downloadData("https://api.eve-central.com/api/marketstat?usesystem={$solarSystemID}&typeid={$typeID}")); |
133 | 133 | } |
134 | 134 | |
135 | - $lowBuy = str_pad(number_format((float) $data->marketstat->type->buy->min, 2),18," ",STR_PAD_LEFT); |
|
136 | - $avgBuy = str_pad(number_format((float) $data->marketstat->type->buy->avg, 2),18," ",STR_PAD_LEFT); |
|
137 | - $highBuy = str_pad(number_format((float) $data->marketstat->type->buy->max, 2),18," ",STR_PAD_LEFT); |
|
138 | - $lowSell = str_pad(number_format((float) $data->marketstat->type->sell->min, 2),18," ",STR_PAD_LEFT); |
|
139 | - $avgSell = str_pad(number_format((float) $data->marketstat->type->sell->avg, 2),18," ",STR_PAD_LEFT); |
|
140 | - $highSell = str_pad(number_format((float) $data->marketstat->type->sell->max, 2),18," ",STR_PAD_LEFT); |
|
135 | + $lowBuy = str_pad(number_format((float) $data->marketstat->type->buy->min, 2), 18, " ", STR_PAD_LEFT); |
|
136 | + $avgBuy = str_pad(number_format((float) $data->marketstat->type->buy->avg, 2), 18, " ", STR_PAD_LEFT); |
|
137 | + $highBuy = str_pad(number_format((float) $data->marketstat->type->buy->max, 2), 18, " ", STR_PAD_LEFT); |
|
138 | + $lowSell = str_pad(number_format((float) $data->marketstat->type->sell->min, 2), 18, " ", STR_PAD_LEFT); |
|
139 | + $avgSell = str_pad(number_format((float) $data->marketstat->type->sell->avg, 2), 18, " ", STR_PAD_LEFT); |
|
140 | + $highSell = str_pad(number_format((float) $data->marketstat->type->sell->max, 2), 18, " ", STR_PAD_LEFT); |
|
141 | 141 | |
142 | 142 | $this->logger->addInfo("Price: Sending pricing info to {$user}"); |
143 | 143 | $solarSystemName = $systemName === 'pc' ? 'Global' : ucfirst($systemName); |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | /** |
91 | 91 | * @param string $query |
92 | 92 | * @param array $params |
93 | - * @param null $db |
|
93 | + * @param string $db |
|
94 | 94 | * @return null|void |
95 | 95 | * @internal param string $db |
96 | 96 | */ |
@@ -237,7 +237,7 @@ discard block |
||
237 | 237 | |
238 | 238 | //CORP INFO |
239 | 239 | /** |
240 | - * @param $corpID |
|
240 | + * @param integer $corpID |
|
241 | 241 | * @param $corpTicker |
242 | 242 | * @param string $corpName |
243 | 243 | */ |
@@ -246,6 +246,9 @@ discard block |
||
246 | 246 | dbExecute('REPLACE INTO corpCache (`corpID`, `corpTicker`, `corpName`) VALUES (:corpID,:corpTicker,:corpName)', array(':corpID' => $corpID, ':corpTicker' => $corpTicker, ':corpName' => $corpName)); |
247 | 247 | } |
248 | 248 | |
249 | +/** |
|
250 | + * @param integer $corpID |
|
251 | + */ |
|
249 | 252 | function getCorpInfo($corpID) |
250 | 253 | { |
251 | 254 | return dbQueryRow('SELECT * FROM corpCache WHERE `corpID` = :corpID', array(':corpID' => $corpID)); |
@@ -290,6 +293,9 @@ discard block |
||
290 | 293 | return $query['typeName']; |
291 | 294 | } |
292 | 295 | |
296 | +/** |
|
297 | + * @return string |
|
298 | + */ |
|
293 | 299 | function getSystemID($solarSystemName) |
294 | 300 | { |
295 | 301 | $query = dbQueryRow('SELECT * FROM mapSolarSystems WHERE lower(`solarSystemName`) = :solarSystemName', array(':solarSystemName' => $solarSystemName), 'eve'); |
@@ -37,7 +37,7 @@ |
||
37 | 37 | $logger->pushHandler(new StreamHandler(__DIR__ . '/../../log/libraryError.log', Logger::DEBUG)); |
38 | 38 | if ($db === null) { |
39 | 39 | $db = __DIR__ . '/../../database/dramiel.sqlite'; |
40 | - } elseif ($db === 'eve'){ |
|
40 | + } elseif ($db === 'eve') { |
|
41 | 41 | $db = __DIR__ . '/../../database/eveData.db'; |
42 | 42 | } |
43 | 43 |