Passed
Branch master (763a28)
by
unknown
03:03
created
src/plugins/onMessage/sysInfo.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
51 51
 			$sysID = urlencode(systemID($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(systemID($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
 			}
@@ -91,8 +91,8 @@  discard block
 block discarded – undo
91 91
 			$regionDetails = regionDetails($regionID);
92 92
 			$regionName = $regionDetails['name'];
93 93
 
94
-			$thisMonth = (string)date('Ym');
95
-            $lastMonth = (string)date('Ym', strtotime('first day of previous month'));
94
+			$thisMonth = (string) date('Ym');
95
+            $lastMonth = (string) date('Ym', strtotime('first day of previous month'));
96 96
 
97 97
             $thisMonthKill = $json->months->$thisMonth->shipsDestroyed;
98 98
             $lastMonthKill = $json->months->$lastMonth->shipsDestroyed;
@@ -102,12 +102,12 @@  discard block
 block discarded – undo
102 102
             $activeChars = $activePVP->characters->count;
103 103
 
104 104
 			$sysName = $systemDetails['name'];
105
-			$secStatus = round($systemDetails['security_status'],2);
105
+			$secStatus = round($systemDetails['security_status'], 2);
106 106
 
107 107
 			$npc = "https://api.eveonline.com/map/kills.xml.aspx";
108 108
 			$npc = new SimpleXMLElement(file_get_contents($npc));
109
-			foreach($npc->result->rowset->row as $row){
110
-				if($row->attributes()->solarSystemID == $sysID){
109
+			foreach ($npc->result->rowset->row as $row) {
110
+				if ($row->attributes()->solarSystemID == $sysID) {
111 111
 					$npcKills = $row->attributes()->factionKills;
112 112
 					$podKills = $row->attributes()->podKills;
113 113
 				}
Please login to merge, or discard this patch.