Passed
Push — master ( 5359ca...7c7d88 )
by Bob
04:42 queued 01:59
created
src/lib/seat.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -38,14 +38,14 @@
 block discarded – undo
38 38
         curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
39 39
         $headers = [];
40 40
         $headers[] = 'Accept: application/json';
41
-        $headers[] = 'X-Token:'.$token;
41
+        $headers[] = 'X-Token:' . $token;
42 42
         curl_setopt($ch, CURLOPT_URL, $seat);
43 43
         curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
44 44
         $result = curl_exec($ch);
45 45
 
46 46
         return $result;
47 47
     } catch (Exception $e) {
48
-        $this->logger->info('SeAT Error: '.$e->getMessage());
48
+        $this->logger->info('SeAT Error: ' . $e->getMessage());
49 49
 
50 50
         return;
51 51
     }
Please login to merge, or discard this patch.
Dramiel.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
  */
25 25
 
26 26
 // Require the vendor stuff
27
-require_once __DIR__.'/vendor/autoload.php';
27
+require_once __DIR__ . '/vendor/autoload.php';
28 28
 
29 29
 // Setup logger
30 30
 use Discord\Discord;
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
 
45 45
 // create a log channel
46 46
 $logger = new Logger('Dramiel');
47
-$logger->pushHandler(new StreamHandler(__DIR__.'/log/dramielLog.log', Logger::DEBUG));
47
+$logger->pushHandler(new StreamHandler(__DIR__ . '/log/dramielLog.log', Logger::DEBUG));
48 48
 $logger->addInfo('Logger Initiated');
49 49
 
50 50
 global $logger;
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
 }
59 59
 
60 60
 // Load the library files (Probably a prettier way to do this that i haven't thought up yet)
61
-foreach (glob(__DIR__.'/src/lib/*.php') as $lib) {
61
+foreach (glob(__DIR__ . '/src/lib/*.php') as $lib) {
62 62
     require_once $lib;
63 63
 }
64 64
 
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
     }
96 96
 }
97 97
 // Number of plugins loaded
98
-$logger->info('Loaded: '.count($pluginsT).' background plugins');
98
+$logger->info('Loaded: ' . count($pluginsT) . ' background plugins');
99 99
 
100 100
 // Load chat plugins
101 101
 $pluginDirs = ['src/plugins/onMessage/*.php'];
@@ -117,47 +117,47 @@  discard block
 block discarded – undo
117 117
 }
118 118
 
119 119
 // Number of chat plugins loaded
120
-$logger->addInfo('Loaded: '.count($plugins).' chat plugins');
120
+$logger->addInfo('Loaded: ' . count($plugins) . ' chat plugins');
121 121
 
122 122
 $ws = new WebSocket($discord);
123 123
 
124 124
 $ws->on(
125 125
     'ready',
126
-    function ($discord) use ($ws, $logger, $config, $plugins, $pluginsT) {
126
+    function($discord) use ($ws, $logger, $config, $plugins, $pluginsT) {
127 127
         // In here we can access any of the WebSocket events.
128 128
         //
129 129
         // There is a list of event constants that you can
130 130
         // find here: https://teamreflex.github.io/DiscordPHP/classes/Discord.WebSockets.Event.html
131 131
         //
132 132
         // We will echo to the console that the WebSocket is ready.
133
-        $logger->addInfo('Discord WebSocket is ready!'.PHP_EOL);
133
+        $logger->addInfo('Discord WebSocket is ready!' . PHP_EOL);
134 134
         $game = new Game(['name' => $config['bot']['game'], 'url' => null, 'type' => null], true);
135 135
         $ws->updatePresence($game, false);
136 136
         // $ws->setNickname($config["bot"]["name"]); //not in yet
137 137
 
138 138
         // Database check
139
-        $ws->loop->addPeriodicTimer(86400, function () use ($logger) {
139
+        $ws->loop->addPeriodicTimer(86400, function() use ($logger) {
140 140
             updateDramielDB($logger);
141 141
             updateCCPData($logger);
142 142
         });
143 143
 
144 144
         // Run the Tick plugins
145
-        $ws->loop->addPeriodicTimer(1, function () use ($pluginsT) {
145
+        $ws->loop->addPeriodicTimer(1, function() use ($pluginsT) {
146 146
             foreach ($pluginsT as $plugin) {
147 147
                 $plugin->tick();
148 148
             }
149 149
         });
150 150
 
151 151
         // Mem cleanup every 30 minutes
152
-        $ws->loop->addPeriodicTimer(1800, function () use ($logger) {
153
-            $logger->addInfo('Memory in use: '.memory_get_usage() / 1024 / 1024 .'MB');
152
+        $ws->loop->addPeriodicTimer(1800, function() use ($logger) {
153
+            $logger->addInfo('Memory in use: ' . memory_get_usage() / 1024 / 1024 . 'MB');
154 154
             gc_collect_cycles(); // Collect garbage
155
-            $logger->addInfo('Memory in use after garbage collection: '.memory_get_usage() / 1024 / 1024 .'MB');
155
+            $logger->addInfo('Memory in use after garbage collection: ' . memory_get_usage() / 1024 / 1024 . 'MB');
156 156
         });
157 157
 
158 158
         $ws->on(
159 159
             Event::MESSAGE_CREATE,
160
-            function ($message, $discord, $newdiscord) use ($logger, $config, $plugins) {
160
+            function($message, $discord, $newdiscord) use ($logger, $config, $plugins) {
161 161
                 $msgData = [
162 162
                     'message' => [
163 163
                         'timestamp'         => $message->timestamp,
@@ -186,7 +186,7 @@  discard block
 block discarded – undo
186 186
                             try {
187 187
                                 $plugin->onMessage($msgData, $message);
188 188
                             } catch (Exception $e) {
189
-                                $logger->addError('Error: '.$e->getMessage());
189
+                                $logger->addError('Error: ' . $e->getMessage());
190 190
                             }
191 191
                         }
192 192
                     }
@@ -197,19 +197,19 @@  discard block
 block discarded – undo
197 197
 );
198 198
 $ws->on(
199 199
     'error',
200
-    function ($error, $ws) use ($logger) {
200
+    function($error, $ws) use ($logger) {
201 201
         $logger->addError($error);
202 202
         exit(1);
203 203
     }
204 204
 );
205 205
 $ws->on(
206 206
     'reconnecting',
207
-    function () use ($logger) {
207
+    function() use ($logger) {
208 208
         $logger->addInfo('Websocket is reconnecting..');
209 209
     });
210 210
 $ws->on(
211 211
     'reconnected',
212
-    function () use ($logger) {
212
+    function() use ($logger) {
213 213
         $logger->addInfo('Websocket was reconnected..');
214 214
     });
215 215
 // Now we will run the ReactPHP Event Loop!
Please login to merge, or discard this patch.