Passed
Pull Request — master (#656)
by Abdul Malik
11:30 queued 05:15
created
src/Hmvc/tests/DemoInterceptor.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -18,6 +18,6 @@
 block discarded – undo
18 18
 {
19 19
     public function process(string $controller, string $action, array $parameters, CoreInterface $core)
20 20
     {
21
-        return '?' . $core->callAction($controller, $action, $parameters) . '!';
21
+        return '?'.$core->callAction($controller, $action, $parameters).'!';
22 22
     }
23 23
 }
Please login to merge, or discard this patch.
src/Hmvc/src/InterceptorPipeline.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -56,12 +56,12 @@
 block discarded – undo
56 56
      */
57 57
     public function callAction(string $controller, string $action, array $parameters = [])
58 58
     {
59
-        if ($this->core === null) {
59
+        if ($this->core === null){
60 60
             throw new InterceptorException('Unable to invoke pipeline without assigned core');
61 61
         }
62 62
 
63 63
         $position = $this->position++;
64
-        if (isset($this->interceptors[$position])) {
64
+        if (isset($this->interceptors[$position])){
65 65
             return $this->interceptors[$position]->process($controller, $action, $parameters, $this);
66 66
         }
67 67
 
Please login to merge, or discard this patch.
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -56,12 +56,14 @@
 block discarded – undo
56 56
      */
57 57
     public function callAction(string $controller, string $action, array $parameters = [])
58 58
     {
59
-        if ($this->core === null) {
59
+        if ($this->core === null)
60
+        {
60 61
             throw new InterceptorException('Unable to invoke pipeline without assigned core');
61 62
         }
62 63
 
63 64
         $position = $this->position++;
64
-        if (isset($this->interceptors[$position])) {
65
+        if (isset($this->interceptors[$position]))
66
+        {
65 67
             return $this->interceptors[$position]->process($controller, $action, $parameters, $this);
66 68
         }
67 69
 
Please login to merge, or discard this patch.
src/Router/tests/SingleActionTest.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -103,9 +103,9 @@
 block discarded – undo
103 103
         $this->assertSame('echoed', (string)$response->getBody());
104 104
 
105 105
         $e = null;
106
-        try {
106
+        try{
107 107
             $router->handle(new ServerRequest([], [], new Uri('/test')));
108
-        } catch (UndefinedRouteException $e) {
108
+        }catch (UndefinedRouteException $e){
109 109
         }
110 110
 
111 111
         $this->assertNotNull($e, 'Autofill not fired');
Please login to merge, or discard this patch.
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -103,9 +103,12 @@
 block discarded – undo
103 103
         $this->assertSame('echoed', (string)$response->getBody());
104 104
 
105 105
         $e = null;
106
-        try {
106
+        try
107
+        {
107 108
             $router->handle(new ServerRequest([], [], new Uri('/test')));
108
-        } catch (UndefinedRouteException $e) {
109
+        }
110
+        catch (UndefinedRouteException $e)
111
+        {
109 112
         }
110 113
 
111 114
         $this->assertNotNull($e, 'Autofill not fired');
Please login to merge, or discard this patch.
src/Router/tests/Diactoros/ResponseFactory.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@
 block discarded – undo
37 37
         $response = new Response('php://memory', $code, []);
38 38
         $response = $response->withStatus($code, $reasonPhrase);
39 39
 
40
-        foreach ($this->config->getBaseHeaders() as $header => $value) {
40
+        foreach ($this->config->getBaseHeaders() as $header => $value){
41 41
             $response = $response->withAddedHeader($header, $value);
42 42
         }
43 43
 
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -37,7 +37,8 @@
 block discarded – undo
37 37
         $response = new Response('php://memory', $code, []);
38 38
         $response = $response->withStatus($code, $reasonPhrase);
39 39
 
40
-        foreach ($this->config->getBaseHeaders() as $header => $value) {
40
+        foreach ($this->config->getBaseHeaders() as $header => $value)
41
+        {
41 42
             $response = $response->withAddedHeader($header, $value);
42 43
         }
43 44
 
Please login to merge, or discard this patch.
src/Router/tests/Diactoros/UploadedFileFactory.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@
 block discarded – undo
26 26
         string $clientFilename = null,
27 27
         string $clientMediaType = null
28 28
     ): UploadedFileInterface {
29
-        if ($size === null) {
29
+        if ($size === null){
30 30
             $size = $stream->getSize();
31 31
         }
32 32
 
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -26,7 +26,8 @@
 block discarded – undo
26 26
         string $clientFilename = null,
27 27
         string $clientMediaType = null
28 28
     ): UploadedFileInterface {
29
-        if ($size === null) {
29
+        if ($size === null)
30
+        {
30 31
             $size = $stream->getSize();
31 32
         }
32 33
 
Please login to merge, or discard this patch.
src/Router/tests/CallableTest.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@
 block discarded – undo
27 27
         $router = $this->makeRouter();
28 28
         $router->setRoute(
29 29
             'action',
30
-            new Route('/something', function () {
30
+            new Route('/something', function (){
31 31
                 return 'hello world';
32 32
             })
33 33
         );
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -27,7 +27,8 @@
 block discarded – undo
27 27
         $router = $this->makeRouter();
28 28
         $router->setRoute(
29 29
             'action',
30
-            new Route('/something', function () {
30
+            new Route('/something', function ()
31
+            {
31 32
                 return 'hello world';
32 33
             })
33 34
         );
Please login to merge, or discard this patch.
src/Router/tests/TestCore.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -24,6 +24,6 @@
 block discarded – undo
24 24
 
25 25
     public function callAction(string $controller, string $action = null, array $parameters = [])
26 26
     {
27
-        return '@wrapped.' . $this->core->callAction($controller, $action, $parameters);
27
+        return '@wrapped.'.$this->core->callAction($controller, $action, $parameters);
28 28
     }
29 29
 }
Please login to merge, or discard this patch.
src/Router/src/Target/Action.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
      */
40 40
     public function __construct(string $controller, $action, int $options = 0)
41 41
     {
42
-        if (!is_string($action) && !is_array($action)) {
42
+        if (!is_string($action) && !is_array($action)){
43 43
             throw new InvalidArgumentException(
44 44
                 sprintf(
45 45
                     'Action parameter must type string or array, `%s` given',
@@ -51,13 +51,13 @@  discard block
 block discarded – undo
51 51
         $this->controller = $controller;
52 52
         $this->action = $action;
53 53
 
54
-        if (is_string($action)) {
54
+        if (is_string($action)){
55 55
             parent::__construct(
56 56
                 ['action' => $action],
57 57
                 ['action' => new Autofill($action)],
58 58
                 $options
59 59
             );
60
-        } else {
60
+        }else{
61 61
             parent::__construct(
62 62
                 ['action' => null],
63 63
                 ['action' => $action],
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
     protected function resolveAction(array $matches): string
81 81
     {
82 82
         $action = $this->action;
83
-        if (is_string($action)) {
83
+        if (is_string($action)){
84 84
             return $action;
85 85
         }
86 86
 
Please login to merge, or discard this patch.
Braces   +9 added lines, -4 removed lines patch added patch discarded remove patch
@@ -39,7 +39,8 @@  discard block
 block discarded – undo
39 39
      */
40 40
     public function __construct(string $controller, $action, int $options = 0)
41 41
     {
42
-        if (!is_string($action) && !is_array($action)) {
42
+        if (!is_string($action) && !is_array($action))
43
+        {
43 44
             throw new InvalidArgumentException(
44 45
                 sprintf(
45 46
                     'Action parameter must type string or array, `%s` given',
@@ -51,13 +52,16 @@  discard block
 block discarded – undo
51 52
         $this->controller = $controller;
52 53
         $this->action = $action;
53 54
 
54
-        if (is_string($action)) {
55
+        if (is_string($action))
56
+        {
55 57
             parent::__construct(
56 58
                 ['action' => $action],
57 59
                 ['action' => new Autofill($action)],
58 60
                 $options
59 61
             );
60
-        } else {
62
+        }
63
+        else
64
+        {
61 65
             parent::__construct(
62 66
                 ['action' => null],
63 67
                 ['action' => $action],
@@ -80,7 +84,8 @@  discard block
 block discarded – undo
80 84
     protected function resolveAction(array $matches): string
81 85
     {
82 86
         $action = $this->action;
83
-        if (is_string($action)) {
87
+        if (is_string($action))
88
+        {
84 89
             return $action;
85 90
         }
86 91
 
Please login to merge, or discard this patch.
src/Router/src/Target/Namespaced.php 2 patches
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -58,7 +58,8 @@
 block discarded – undo
58 58
      */
59 59
     protected function resolveController(array $matches): string
60 60
     {
61
-        if (preg_match('/[^a-z_0-9\-]/i', $matches['controller'])) {
61
+        if (preg_match('/[^a-z_0-9\-]/i', $matches['controller']))
62
+        {
62 63
             throw new TargetException('Invalid namespace target, controller name not allowed.');
63 64
         }
64 65
 
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
         string $namespace,
34 34
         string $postfix = 'Controller',
35 35
         int $options = 0
36
-    ) {
36
+    ){
37 37
         $this->namespace = rtrim($namespace, '\\');
38 38
         $this->postfix = ucfirst($postfix);
39 39
 
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
      */
52 52
     protected function resolveController(array $matches): string
53 53
     {
54
-        if (preg_match('/[^a-z_0-9\-]/i', $matches['controller'])) {
54
+        if (preg_match('/[^a-z_0-9\-]/i', $matches['controller'])){
55 55
             throw new TargetException('Invalid namespace target, controller name not allowed.');
56 56
         }
57 57
 
Please login to merge, or discard this patch.