@@ -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 | |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | { |
| 30 | 30 | $channelID = (int) $msgData['message']['channelID']; |
| 31 | 31 | |
| 32 | - if(in_array($channelID, $this->excludeChannel, true)) |
|
| 32 | + if (in_array($channelID, $this->excludeChannel, true)) |
|
| 33 | 33 | { |
| 34 | 34 | return null; |
| 35 | 35 | } |
@@ -40,10 +40,10 @@ discard block |
||
| 40 | 40 | $user = $msgData['message']['from']; |
| 41 | 41 | |
| 42 | 42 | $data = command($message, $this->information()['trigger'], $this->config['bot']['trigger']); |
| 43 | - if(isset($data['trigger'])) |
|
| 43 | + if (isset($data['trigger'])) |
|
| 44 | 44 | { |
| 45 | 45 | $messageString = strstr($data['messageString'], '@') ? str_replace('<@', '', str_replace('>', '', $data['messageString'])) : $data['messageString']; |
| 46 | - if(is_numeric($messageString)) |
|
| 46 | + if (is_numeric($messageString)) |
|
| 47 | 47 | { |
| 48 | 48 | $messageString = dbQueryField('SELECT name FROM usersSeen WHERE id = :id', 'name', array(':id' => $messageString)); |
| 49 | 49 | } |
@@ -51,29 +51,29 @@ discard block |
||
| 51 | 51 | $sysID = urlencode(getSystemID($cleanString)); |
| 52 | 52 | |
| 53 | 53 | //Check if we get a system back, otherwise check for partials |
| 54 | - if(empty($sysID)) |
|
| 54 | + if (empty($sysID)) |
|
| 55 | 55 | { |
| 56 | 56 | $search = "http://tools.pandemic-legion.pl/api/search/{$cleanString}"; |
| 57 | 57 | $search = json_decode(file_get_contents($search)); |
| 58 | 58 | $tot = 0; |
| 59 | 59 | $res = array(); |
| 60 | - foreach ($search as $s){ |
|
| 61 | - if ($s->type == "system"){ |
|
| 60 | + foreach ($search as $s) { |
|
| 61 | + if ($s->type == "system") { |
|
| 62 | 62 | $tot++; |
| 63 | 63 | $res[] = $s->name; |
| 64 | 64 | } |
| 65 | 65 | } |
| 66 | - if ($tot == 0){ |
|
| 66 | + if ($tot == 0) { |
|
| 67 | 67 | return $this->message->reply('**Error:** no data available'); |
| 68 | 68 | } |
| 69 | - if ($tot == 1){ |
|
| 69 | + if ($tot == 1) { |
|
| 70 | 70 | $sysID = urlencode(getSystemID($res[0])); |
| 71 | - if(empty($sysID)){ |
|
| 71 | + if (empty($sysID)) { |
|
| 72 | 72 | return $this->message->reply('**Error:** no data available'); |
| 73 | 73 | } |
| 74 | 74 | } |
| 75 | - if ($tot > 1){ |
|
| 76 | - $res = implode(", ",$res); |
|
| 75 | + if ($tot > 1) { |
|
| 76 | + $res = implode(", ", $res); |
|
| 77 | 77 | return $this->message->reply("**Error:** Did you mean one of these? {$res}"); |
| 78 | 78 | } |
| 79 | 79 | } |
@@ -90,8 +90,8 @@ discard block |
||
| 90 | 90 | $regionID = $json->info->regionID; |
| 91 | 91 | $regionName = getRegionName($regionID); |
| 92 | 92 | |
| 93 | - $thisMonth = (string)date('Ym'); |
|
| 94 | - $lastMonth = (string)date('Ym', strtotime('first day of previous month')); |
|
| 93 | + $thisMonth = (string) date('Ym'); |
|
| 94 | + $lastMonth = (string) date('Ym', strtotime('first day of previous month')); |
|
| 95 | 95 | |
| 96 | 96 | $thisMonthKill = $json->months->$thisMonth->shipsDestroyed; |
| 97 | 97 | $lastMonthKill = $json->months->$lastMonth->shipsDestroyed; |
@@ -101,12 +101,12 @@ discard block |
||
| 101 | 101 | $activeChars = $activePVP->characters->count; |
| 102 | 102 | |
| 103 | 103 | $sysName = $systemDetails['name']; |
| 104 | - $secStatus = round($systemDetails['security_status'],2); |
|
| 104 | + $secStatus = round($systemDetails['security_status'], 2); |
|
| 105 | 105 | |
| 106 | 106 | $npc = "https://api.eveonline.com/map/kills.xml.aspx"; |
| 107 | 107 | $npc = new SimpleXMLElement(file_get_contents($npc)); |
| 108 | - foreach($npc->result->rowset->row as $row){ |
|
| 109 | - if($row->attributes()->solarSystemID == $sysID){ |
|
| 108 | + foreach ($npc->result->rowset->row as $row) { |
|
| 109 | + if ($row->attributes()->solarSystemID == $sysID) { |
|
| 110 | 110 | $npcKills = $row->attributes()->factionKills; |
| 111 | 111 | $podKills = $row->attributes()->podKills; |
| 112 | 112 | } |