@@ -26,17 +26,17 @@ discard block |
||
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 | |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | public function defaultContentTypeIsSetWhenDefined() |
47 | 47 | { |
48 | 48 | /** @var ContentBasedErrorHandler $instance */ |
49 | - $instance = $this->factory->__invoke(new ServiceManager(['services' => [ |
|
49 | + $instance = $this->factory->__invoke(new ServiceManager([ 'services' => [ |
|
50 | 50 | ErrorHandlerManager::class => $this->prophesize(ErrorHandlerManager::class)->reveal(), |
51 | 51 | LogMessageBuilderInterface::class => $this->prophesize(LogMessageBuilderInterface::class)->reveal(), |
52 | 52 | 'config' => [ |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | 'default_content_type' => 'application/json', |
55 | 55 | ], |
56 | 56 | ], |
57 | - ]])); |
|
57 | + ] ])); |
|
58 | 58 | |
59 | 59 | $ref = new \ReflectionObject($instance); |
60 | 60 | $prop = $ref->getProperty('defaultContentType'); |
@@ -21,15 +21,15 @@ discard block |
||
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 |
||
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 | ); |
@@ -86,8 +86,8 @@ discard block |
||
86 | 86 | { |
87 | 87 | $this->errorHandler = new ContentBasedErrorHandler(new ErrorHandlerManager(new ServiceManager(), [ |
88 | 88 | 'factories' => [ |
89 | - 'text/html' => [$this, 'factory'], |
|
90 | - 'application/json' => [$this, 'factory'], |
|
89 | + 'text/html' => [ $this, 'factory' ], |
|
90 | + 'application/json' => [ $this, 'factory' ], |
|
91 | 91 | ], |
92 | 92 | ]), new NullLogger(), new BasicLogMessageBuilder(), 'application/json'); |
93 | 93 | $request = ServerRequestFactory::fromGlobals()->withHeader('Accept', 'foo/bar,text/xml'); |
@@ -25,8 +25,8 @@ discard block |
||
25 | 25 | */ |
26 | 26 | public function __invoke(ContainerInterface $container) |
27 | 27 | { |
28 | - $config = $container->has('config') ? $container->get('config') : []; |
|
29 | - $ehConfig = isset($config['error_handler']) ? $config['error_handler'] : []; |
|
28 | + $config = $container->has('config') ? $container->get('config') : [ ]; |
|
29 | + $ehConfig = isset($config[ 'error_handler' ]) ? $config[ 'error_handler' ] : [ ]; |
|
30 | 30 | |
31 | 31 | $errorHandlerManager = $container->get(ErrorHandlerManager::class); |
32 | 32 | $logger = $container->has(LoggerInterface::class) ? $container->get(LoggerInterface::class) : new NullLogger(); |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | $errorHandlerManager, |
37 | 37 | $logger, |
38 | 38 | $logMessageBuilder, |
39 | - isset($ehConfig['default_content_type']) ? $ehConfig['default_content_type'] : 'text/html' |
|
39 | + isset($ehConfig[ 'default_content_type' ]) ? $ehConfig[ 'default_content_type' ] : 'text/html' |
|
40 | 40 | ); |
41 | 41 | } |
42 | 42 | } |