Passed
Push — master ( 5b3043...a2340d )
by butschster
09:28 queued 02:04
created
src/Http/src/Middleware/ErrorHandlerMiddleware.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
         private readonly ResponseFactoryInterface $responseFactory,
33 33
         private readonly ExceptionHandlerInterface $errorHandler,
34 34
         private readonly Verbosity $verbosity
35
-    ) {
35
+    ){
36 36
     }
37 37
 
38 38
     /**
@@ -41,17 +41,17 @@  discard block
 block discarded – undo
41 41
      */
42 42
     public function process(Request $request, Handler $handler): Response
43 43
     {
44
-        try {
44
+        try{
45 45
             return $handler->handle($request);
46
-        } catch (ClientException|RouterException $e) {
46
+        }catch (ClientException | RouterException $e){
47 47
             $code = $e instanceof ClientException ? $e->getCode() : 404;
48
-        } catch (\Throwable $e) {
48
+        }catch (\Throwable $e){
49 49
             $code = 500;
50 50
         }
51 51
 
52 52
         $this->errorHandler->report($e);
53 53
 
54
-        if (!$this->suppressErrors->suppressed()) {
54
+        if (!$this->suppressErrors->suppressed()){
55 55
             return $this->renderError($request, $e, $code);
56 56
         }
57 57
 
@@ -69,8 +69,8 @@  discard block
 block discarded – undo
69 69
 
70 70
         [$format, $renderer] = $this->getRenderer($this->errorHandler, $request);
71 71
 
72
-        if ($format !== null) {
73
-            $response = $response->withHeader('Content-Type', $format . '; charset=UTF-8');
72
+        if ($format !== null){
73
+            $response = $response->withHeader('Content-Type', $format.'; charset=UTF-8');
74 74
         }
75 75
 
76 76
         $response->getBody()->write(
@@ -89,12 +89,12 @@  discard block
 block discarded – undo
89 89
      */
90 90
     private function getRenderer(ExceptionHandlerInterface $handler, Request $request): array
91 91
     {
92
-        if ($request->hasHeader('Accept')) {
92
+        if ($request->hasHeader('Accept')){
93 93
             $acceptItems = AcceptHeader::fromString($request->getHeaderLine('Accept'))->getAll();
94
-            foreach ($acceptItems as $item) {
94
+            foreach ($acceptItems as $item){
95 95
                 $format = $item->getValue();
96 96
                 $renderer = $handler->getRenderer($format);
97
-                if ($renderer !== null) {
97
+                if ($renderer !== null){
98 98
                     return [$format, $renderer];
99 99
                 }
100 100
             }
Please login to merge, or discard this patch.
src/Exceptions/src/Verbosity.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@
 block discarded – undo
17 17
 
18 18
     public static function detect(EnvironmentInterface $environment): self
19 19
     {
20
-        return match (\strtolower((string) $environment->get('VERBOSITY_LEVEL'))) {
20
+        return match (\strtolower((string)$environment->get('VERBOSITY_LEVEL'))) {
21 21
             'basic', '0' => self::BASIC,
22 22
             'debug', '2' => self::DEBUG,
23 23
             default => self::VERBOSE
Please login to merge, or discard this patch.