Completed
Push — master ( 4f2901...8bf861 )
by Arnold
02:45
created
tests/ErrorHandlerTest.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
     public function testInvokeCatchError()
103 103
     {
104 104
         if (!class_exists('Error')) {
105
-            $this->markTestSkipped(PHP_VERSION . " doesn't throw errors yet");
105
+            $this->markTestSkipped(PHP_VERSION." doesn't throw errors yet");
106 106
         }
107 107
         
108 108
         $request = $this->createMock(ServerRequestInterface::class);
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
         
156 156
         $exception = $this->createMock(\Exception::class);
157 157
         
158
-        $message = $this->stringStartsWith('Uncaught Exception ' . get_class($exception));
158
+        $message = $this->stringStartsWith('Uncaught Exception '.get_class($exception));
159 159
         $context = ['exception' => $exception];
160 160
         
161 161
         $logger = $this->createMock(LoggerInterface::class);
@@ -221,7 +221,7 @@  discard block
 block discarded – undo
221 221
     {
222 222
         $exception = $this->createMock(\Exception::class);
223 223
         
224
-        $message = $this->stringStartsWith('Uncaught Exception ' . get_class($exception));
224
+        $message = $this->stringStartsWith('Uncaught Exception '.get_class($exception));
225 225
         $context = ['exception' => $exception];
226 226
         
227 227
         $logger = $this->createMock(LoggerInterface::class);
@@ -517,7 +517,7 @@  discard block
 block discarded – undo
517 517
         
518 518
         $callback = $this->getMockBuilder(\stdClass::class)->setMethods(['__invoke'])->getMock();
519 519
         $callback->expects($this->once())->method('__invoke')
520
-            ->with($this->callback(function($error){
520
+            ->with($this->callback(function($error) {
521 521
                 $this->assertInstanceOf(\ErrorException::class, $error);
522 522
                 $this->assertEquals('no good', $error->getMessage());
523 523
                 $this->assertEquals('foo.php', $error->getFile());
Please login to merge, or discard this patch.
src/ErrorHandler.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
             return $this->logException($error);
99 99
         }
100 100
         
101
-        $message = "Unable to log a " . (is_object($error) ? get_class($error) . ' ' : '') . gettype($error);
101
+        $message = "Unable to log a ".(is_object($error) ? get_class($error).' ' : '').gettype($error);
102 102
         $this->getLogger()->log(LogLevel::WARNING, $message);
103 103
     }
104 104
     
@@ -192,9 +192,9 @@  discard block
 block discarded – undo
192 192
         try {
193 193
             $this->error = null;
194 194
             $nextResponse = $next($request, $response);
195
-        } catch(\Error $e) {
195
+        } catch (\Error $e) {
196 196
             $this->error = $e;
197
-        } catch(\Exception $e) {
197
+        } catch (\Exception $e) {
198 198
             $this->error = $e;
199 199
         }
200 200
         
@@ -241,7 +241,7 @@  discard block
 block discarded – undo
241 241
         $this->logErrorTypes |= $errorTypes;
242 242
         
243 243
         $nonFatal = E_WARNING | E_NOTICE | E_USER_WARNING | E_USER_NOTICE | E_STRICT | E_DEPRECATED | E_USER_DEPRECATED;
244
-        $unhandled = E_ERROR|E_PARSE|E_CORE_ERROR|E_COMPILE_ERROR;
244
+        $unhandled = E_ERROR | E_PARSE | E_CORE_ERROR | E_COMPILE_ERROR;
245 245
             
246 246
         if ($this->logErrorTypes & $nonFatal) {
247 247
             $this->initErrorHandler();
@@ -340,7 +340,7 @@  discard block
 block discarded – undo
340 340
         $this->reservedMemory = null;
341 341
         
342 342
         $err = $this->errorGetLast();
343
-        $unhandled = E_ERROR|E_PARSE|E_CORE_ERROR|E_COMPILE_ERROR;
343
+        $unhandled = E_ERROR | E_PARSE | E_CORE_ERROR | E_COMPILE_ERROR;
344 344
         
345 345
         if (!$err || !($err['type'] & $unhandled)) {
346 346
             return;
Please login to merge, or discard this patch.