Passed
Pull Request — master (#232)
by Pavel
02:21
created
src/Http/Middleware/JsonPayloadMiddleware.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -41,9 +41,9 @@  discard block
 block discarded – undo
41 41
      */
42 42
     public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
43 43
     {
44
-        if ($this->isJsonPayload($request)) {
44
+        if ($this->isJsonPayload($request)){
45 45
             $request = $request->withParsedBody(json_decode((string)$request->getBody(), true));
46
-            if (json_last_error() !== 0) {
46
+            if (json_last_error() !== 0){
47 47
                 throw new ClientException(400, 'invalid json payload');
48 48
             }
49 49
         }
@@ -59,8 +59,8 @@  discard block
 block discarded – undo
59 59
     {
60 60
         $contentType = $request->getHeaderLine('Content-Type');
61 61
 
62
-        foreach ($this->httpConfig->getJsonContentType() as $allowedType) {
63
-            if (stripos($contentType, $allowedType) === 0) {
62
+        foreach ($this->httpConfig->getJsonContentType() as $allowedType){
63
+            if (stripos($contentType, $allowedType) === 0){
64 64
                 return true;
65 65
             }
66 66
         }
Please login to merge, or discard this patch.
Braces   +8 added lines, -4 removed lines patch added patch discarded remove patch
@@ -41,9 +41,11 @@  discard block
 block discarded – undo
41 41
      */
42 42
     public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
43 43
     {
44
-        if ($this->isJsonPayload($request)) {
44
+        if ($this->isJsonPayload($request))
45
+        {
45 46
             $request = $request->withParsedBody(json_decode((string)$request->getBody(), true));
46
-            if (json_last_error() !== 0) {
47
+            if (json_last_error() !== 0)
48
+            {
47 49
                 throw new ClientException(400, 'invalid json payload');
48 50
             }
49 51
         }
@@ -59,8 +61,10 @@  discard block
 block discarded – undo
59 61
     {
60 62
         $contentType = $request->getHeaderLine('Content-Type');
61 63
 
62
-        foreach ($this->httpConfig->getJsonContentType() as $allowedType) {
63
-            if (stripos($contentType, $allowedType) === 0) {
64
+        foreach ($this->httpConfig->getJsonContentType() as $allowedType)
65
+        {
66
+            if (stripos($contentType, $allowedType) === 0)
67
+            {
64 68
                 return true;
65 69
             }
66 70
         }
Please login to merge, or discard this patch.
tests/app/src/Bootloader/AppBootloader.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@
 block discarded – undo
52 52
         $rbac->addRole('demo');
53 53
         $rbac->associate('demo', 'demo.*');
54 54
 
55
-        $views->addDirectory('custom', __DIR__ . '/../../views/custom/');
55
+        $views->addDirectory('custom', __DIR__.'/../../views/custom/');
56 56
         $views->addEngine(TestEngine::class);
57 57
 
58 58
         $validation->addAlias('aliased', 'notEmpty');
Please login to merge, or discard this patch.