Passed
Pull Request — master (#267)
by
unknown
02:31
created
src/Http/Middleware/JsonPayloadMiddleware.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -43,11 +43,11 @@  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
             $body = (string)$request->getBody();
48
-            if ($body !== '') {
48
+            if ($body !== ''){
49 49
                 $request = $request->withParsedBody(json_decode($body, true));
50
-                if (json_last_error() !== 0) {
50
+                if (json_last_error() !== 0){
51 51
                     throw new ClientException(400, 'invalid json payload');
52 52
                 }
53 53
             }
@@ -64,8 +64,8 @@  discard block
 block discarded – undo
64 64
     {
65 65
         $contentType = $request->getHeaderLine('Content-Type');
66 66
 
67
-        foreach ($this->config->getContentTypes() as $allowedType) {
68
-            if (stripos($contentType, $allowedType) === 0) {
67
+        foreach ($this->config->getContentTypes() as $allowedType){
68
+            if (stripos($contentType, $allowedType) === 0){
69 69
                 return true;
70 70
             }
71 71
         }
Please login to merge, or discard this patch.