Completed
Pull Request — master (#25)
by Pavel
64:50
created
src/Components/Recorder.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
             case 'data':
88 88
                 return $this->getData();
89 89
             case 'status_code':
90
-                if($e===null) {
90
+                if ($e === null) {
91 91
                                     return 0;
92 92
                 }
93 93
                 return $this->getStatusCode($e);
@@ -167,12 +167,12 @@  discard block
 block discarded – undo
167 167
      * @param  array $data The array to remove keys from
168 168
      * @return void
169 169
      */
170
-    protected function excludeKeys(array $data){
170
+    protected function excludeKeys(array $data) {
171 171
         $keys = isset($this->config['excludeKeys']) ? $this->config['excludeKeys'] : [];
172 172
         foreach ($data as $key => &$value) {
173
-            if(in_array($key,$keys)){
173
+            if (in_array($key, $keys)) {
174 174
                 unset($data[$key]);
175
-            } else if(is_array($value)){
175
+            } else if (is_array($value)) {
176 176
                 $value = $this->excludeKeys($value);
177 177
             }
178 178
         }
Please login to merge, or discard this patch.
src/Components/Notifier.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -3,7 +3,6 @@
 block discarded – undo
3 3
 namespace Tylercd100\LERN\Components;
4 4
 
5 5
 use Exception;
6
-use Illuminate\Container\Container;
7 6
 use Monolog\Handler\HandlerInterface;
8 7
 use Monolog\Logger;
9 8
 use Tylercd100\LERN\Exceptions\NotifierFailedException;
Please login to merge, or discard this patch.
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -60,9 +60,9 @@  discard block
 block discarded – undo
60 60
         if (is_callable($this->messageCb)) {
61 61
             return $this->messageCb->__invoke($e);
62 62
         } else {
63
-            $msg = get_class($e) . " was thrown! \n" . $e->getMessage();
63
+            $msg = get_class($e)." was thrown! \n".$e->getMessage();
64 64
             if ($this->config['includeExceptionStackTrace'] === true) {
65
-                $msg .= "\n\n" . $e->getTraceAsString();
65
+                $msg .= "\n\n".$e->getTraceAsString();
66 66
             }
67 67
             return $msg;
68 68
         }
@@ -143,55 +143,55 @@  discard block
 block discarded – undo
143 143
         $app = app();
144 144
 
145 145
         // Add sound ro pushover
146
-        if(in_array('pushover', $this->config['drivers']))
146
+        if (in_array('pushover', $this->config['drivers']))
147 147
         {
148 148
             $context['sound'] = $this->config['pushover']['sound'];
149 149
         }
150 150
 
151 151
         // Add exception context for raven for better handling in Sentry
152
-        if(in_array('raven', $this->config['drivers']))
152
+        if (in_array('raven', $this->config['drivers']))
153 153
         {
154 154
             $context['exception'] = $e;
155 155
         }
156 156
 
157 157
         // Add auth data if available.
158
-        if(isset($app['auth']) && $user = $app['auth']->user())
158
+        if (isset($app['auth']) && $user = $app['auth']->user())
159 159
         {
160
-            if(empty($context['user']) or !is_array($context['user']))
160
+            if (empty($context['user']) or !is_array($context['user']))
161 161
             {
162 162
                 $context['user'] = [];
163 163
             }
164 164
 
165
-            if(!isset($context['user']['id']) && method_exists($user, 'getAuthIdentifier'))
165
+            if (!isset($context['user']['id']) && method_exists($user, 'getAuthIdentifier'))
166 166
             {
167 167
                 $context['user']['id'] = $user->getAuthIdentifier();
168 168
             }
169 169
 
170
-            if(!isset($context['user']['id']) && method_exists($user, 'getKey'))
170
+            if (!isset($context['user']['id']) && method_exists($user, 'getKey'))
171 171
             {
172 172
                 $context['user']['id'] = $user->getKey();
173 173
             }
174 174
 
175
-            if(!isset($context['user']['id']) && isset($user->id))
175
+            if (!isset($context['user']['id']) && isset($user->id))
176 176
             {
177 177
                 $context['user']['id'] = $user->id;
178 178
             }
179 179
         }
180 180
 
181 181
         // Add session data if available.
182
-        if(isset($app['session']) && $session = $app['session']->all())
182
+        if (isset($app['session']) && $session = $app['session']->all())
183 183
         {
184
-            if(empty($context['user']) or !is_array($context['user']))
184
+            if (empty($context['user']) or !is_array($context['user']))
185 185
             {
186 186
                 $context['user'] = [];
187 187
             }
188 188
 
189
-            if(!isset($context['user']['id']))
189
+            if (!isset($context['user']['id']))
190 190
             {
191 191
                 $context['user']['id'] = $app->session->getId();
192 192
             }
193 193
 
194
-            if(isset($context['user']['data']))
194
+            if (isset($context['user']['data']))
195 195
             {
196 196
                 $context['user']['data'] = array_merge($session, $context['user']['data']);
197 197
             } else
@@ -207,7 +207,7 @@  discard block
 block discarded – undo
207 207
         ];
208 208
 
209 209
         // Add tags to context.
210
-        if(isset($context['tags']))
210
+        if (isset($context['tags']))
211 211
         {
212 212
             $context['tags'] = array_merge($tags, $context['tags']);
213 213
         } else
@@ -225,7 +225,7 @@  discard block
 block discarded – undo
225 225
         $extra = array_merge($extra, array_except($context, ['user', 'tags', 'level', 'extra']));
226 226
 
227 227
         // Add extra to context.
228
-        if(isset($context['extra']))
228
+        if (isset($context['extra']))
229 229
         {
230 230
             $context['extra'] = array_merge($extra, $context['extra']);
231 231
         } else
Please login to merge, or discard this patch.
src/LERNServiceProvider.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@  discard block
 block discarded – undo
7 7
 class LERNServiceProvider extends ServiceProvider
8 8
 {
9 9
     public function register() {
10
-        $this->mergeConfigFrom(__DIR__ . '/../config/lern.php', 'lern');
10
+        $this->mergeConfigFrom(__DIR__.'/../config/lern.php', 'lern');
11 11
 
12 12
         $this->handleDeprecatedConfigValues();
13 13
 
@@ -19,9 +19,9 @@  discard block
 block discarded – undo
19 19
     public function boot()
20 20
     {
21 21
         $this->publishes([
22
-            __DIR__ . '/../migrations/2016_03_17_000000_create_lern_tables.php' => base_path('database/migrations/2016_03_17_000000_create_lern_tables.php'),
23
-            __DIR__ . '/../migrations/2016_03_27_000000_add_user_data_and_url_to_lern_tables.php' => base_path('database/migrations/2016_03_27_000000_add_user_data_and_url_to_lern_tables.php'),
24
-            __DIR__ . '/../config/lern.php' => base_path('config/lern.php'),
22
+            __DIR__.'/../migrations/2016_03_17_000000_create_lern_tables.php' => base_path('database/migrations/2016_03_17_000000_create_lern_tables.php'),
23
+            __DIR__.'/../migrations/2016_03_27_000000_add_user_data_and_url_to_lern_tables.php' => base_path('database/migrations/2016_03_27_000000_add_user_data_and_url_to_lern_tables.php'),
24
+            __DIR__.'/../config/lern.php' => base_path('config/lern.php'),
25 25
         ]);   
26 26
     }
27 27
 
Please login to merge, or discard this patch.