Completed
Push — master ( 4d222f...773846 )
by Alejandro
03:19
created
src/ErrorHandler/Factory/ErrorHandlerManagerFactory.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -21,9 +21,9 @@
 block discarded – undo
21 21
      */
22 22
     public function __invoke(ContainerInterface $container)
23 23
     {
24
-        $config = $container->has('config') ? $container->get('config') : [];
25
-        $errorHandlerConfig = isset($config['error_handler']) ? $config['error_handler'] : [];
26
-        $plugins = isset($errorHandlerConfig['plugins']) ? $errorHandlerConfig['plugins'] : [];
24
+        $config = $container->has('config') ? $container->get('config') : [ ];
25
+        $errorHandlerConfig = isset($config[ 'error_handler' ]) ? $config[ 'error_handler' ] : [ ];
26
+        $plugins = isset($errorHandlerConfig[ 'plugins' ]) ? $errorHandlerConfig[ 'plugins' ] : [ ];
27 27
         return new ErrorHandlerManager($container, $plugins);
28 28
     }
29 29
 }
Please login to merge, or discard this patch.
src/ErrorHandler/ContentBasedErrorHandler.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -68,7 +68,7 @@
 block discarded – undo
68 68
         $accepts = $request->hasHeader('Accept') ? $request->getHeaderLine('Accept') : self::DEFAULT_CONTENT;
69 69
         $accepts = explode(',', $accepts);
70 70
         foreach ($accepts as $accept) {
71
-            if (! $this->errorHandlerManager->has($accept)) {
71
+            if (!$this->errorHandlerManager->has($accept)) {
72 72
                 continue;
73 73
             }
74 74
 
Please login to merge, or discard this patch.
src/Log/BasicLogMessageBuilder.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -17,10 +17,10 @@
 block discarded – undo
17 17
     public function buildMessage(Request $request, Response $response, $err = null)
18 18
     {
19 19
         $base = 'Error occurred while dispatching request';
20
-        if (! isset($err)) {
20
+        if (!isset($err)) {
21 21
             return $base;
22 22
         }
23 23
 
24
-        return $base . ': ' . PHP_EOL . $err;
24
+        return $base.': '.PHP_EOL.$err;
25 25
     }
26 26
 }
Please login to merge, or discard this patch.
test/ErrorHandler/Factory/ErrorHandlerManagerFactoryTest.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -23,13 +23,13 @@
 block discarded – undo
23 23
      */
24 24
     public function serviceIsCreated()
25 25
     {
26
-        $instance = $this->factory->__invoke(new ServiceManager(['services' => [
26
+        $instance = $this->factory->__invoke(new ServiceManager([ 'services' => [
27 27
             'config' => [
28 28
                 'error_handler' => [
29
-                    'plugins' => [],
29
+                    'plugins' => [ ],
30 30
                 ],
31 31
             ],
32
-        ]]));
32
+        ] ]));
33 33
         $this->assertInstanceOf(ErrorHandlerManager::class, $instance);
34 34
     }
35 35
 }
Please login to merge, or discard this patch.
test/ErrorHandler/Factory/ContentBasedErrorHandlerFactoryTest.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -26,17 +26,17 @@
 block discarded – undo
26 26
      */
27 27
     public function serviceIsCreated()
28 28
     {
29
-        $instance = $this->factory->__invoke(new ServiceManager(['services' => [
29
+        $instance = $this->factory->__invoke(new ServiceManager([ 'services' => [
30 30
             ErrorHandlerManager::class => $this->prophesize(ErrorHandlerManager::class)->reveal(),
31 31
             LogMessageBuilderInterface::class => $this->prophesize(LogMessageBuilderInterface::class)->reveal(),
32
-        ]]));
32
+        ] ]));
33 33
         $this->assertInstanceOf(ContentBasedErrorHandler::class, $instance);
34 34
 
35
-        $instance = $this->factory->__invoke(new ServiceManager(['services' => [
35
+        $instance = $this->factory->__invoke(new ServiceManager([ 'services' => [
36 36
             ErrorHandlerManager::class => $this->prophesize(ErrorHandlerManager::class)->reveal(),
37 37
             LogMessageBuilderInterface::class => $this->prophesize(LogMessageBuilderInterface::class)->reveal(),
38 38
             LoggerInterface::class => $this->prophesize(LoggerInterface::class)->reveal(),
39
-        ]]));
39
+        ] ]));
40 40
         $this->assertInstanceOf(ContentBasedErrorHandler::class, $instance);
41 41
     }
42 42
 }
Please login to merge, or discard this patch.
test/ErrorHandler/ContentBasedErrorHandlerTest.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -21,15 +21,15 @@  discard block
 block discarded – undo
21 21
     {
22 22
         $this->errorHandler = new ContentBasedErrorHandler(new ErrorHandlerManager(new ServiceManager(), [
23 23
             'factories' => [
24
-                'text/html' => [$this, 'factory'],
25
-                'application/json' => [$this, 'factory'],
24
+                'text/html' => [ $this, 'factory' ],
25
+                'application/json' => [ $this, 'factory' ],
26 26
             ],
27 27
         ]), new NullLogger(), new BasicLogMessageBuilder());
28 28
     }
29 29
 
30 30
     public function factory($container, $name)
31 31
     {
32
-        return function () use ($name) {
32
+        return function() use ($name) {
33 33
             return $name;
34 34
         };
35 35
     }
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
     public function ifNoErrorHandlerIsFoundAnExceptionIsThrown()
72 72
     {
73 73
         $this->errorHandler = new ContentBasedErrorHandler(
74
-            new ErrorHandlerManager(new ServiceManager(), []),
74
+            new ErrorHandlerManager(new ServiceManager(), [ ]),
75 75
             new NullLogger(),
76 76
             new BasicLogMessageBuilder()
77 77
         );
Please login to merge, or discard this patch.
test/ErrorHandler/ErrorHandlerManagerTest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@
 block discarded – undo
16 16
     {
17 17
         $this->pluginManager = new ErrorHandlerManager(new ServiceManager(), [
18 18
             'services' => [
19
-                'foo' => function () {
19
+                'foo' => function() {
20 20
                 },
21 21
             ],
22 22
             'invokables' => [
Please login to merge, or discard this patch.
test/Log/BasicLogMessageBuilderTest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -34,6 +34,6 @@
 block discarded – undo
34 34
     {
35 35
         $err = 'A super critical error';
36 36
         $message = $this->messageBuilder->buildMessage(ServerRequestFactory::fromGlobals(), new Response(), $err);
37
-        $this->assertEquals('Error occurred while dispatching request: ' . PHP_EOL . $err, $message);
37
+        $this->assertEquals('Error occurred while dispatching request: '.PHP_EOL.$err, $message);
38 38
     }
39 39
 }
Please login to merge, or discard this patch.