Passed
Pull Request — master (#233)
by Pavel
03:51 queued 01:19
created
src/Http/Middleware/JsonPayloadMiddleware.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -43,9 +43,9 @@  discard block
 block discarded – undo
43 43
      */
44 44
     public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
45 45
     {
46
-        if ($this->isJsonPayload($request)) {
46
+        if ($this->isJsonPayload($request)){
47 47
             $request = $request->withParsedBody(json_decode((string)$request->getBody(), true));
48
-            if (json_last_error() !== 0) {
48
+            if (json_last_error() !== 0){
49 49
                 throw new ClientException(400, 'invalid json payload');
50 50
             }
51 51
         }
@@ -61,8 +61,8 @@  discard block
 block discarded – undo
61 61
     {
62 62
         $contentType = $request->getHeaderLine('Content-Type');
63 63
 
64
-        foreach ($this->config->getContentTypes() as $allowedType) {
65
-            if (stripos($contentType, $allowedType) === 0) {
64
+        foreach ($this->config->getContentTypes() as $allowedType){
65
+            if (stripos($contentType, $allowedType) === 0){
66 66
                 return true;
67 67
             }
68 68
         }
Please login to merge, or discard this patch.