Passed
Push — master ( 035a69...ef3bdc )
by Kirill
03:22
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 1 patch
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.
src/Hmvc/src/AbstractCore.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -45,9 +45,9 @@  discard block
 block discarded – undo
45 45
      */
46 46
     public function callAction(string $controller, string $action, array $parameters = [])
47 47
     {
48
-        try {
48
+        try{
49 49
             $method = new \ReflectionMethod($controller, $action);
50
-        } catch (\ReflectionException $e) {
50
+        }catch (\ReflectionException $e){
51 51
             throw new ControllerException(
52 52
                 "Invalid action `{$controller}`->`{$action}`",
53 53
                 ControllerException::BAD_ACTION,
@@ -55,22 +55,22 @@  discard block
 block discarded – undo
55 55
             );
56 56
         }
57 57
 
58
-        if ($method->isStatic() || !$method->isPublic()) {
58
+        if ($method->isStatic() || !$method->isPublic()){
59 59
             throw new ControllerException(
60 60
                 "Invalid action `{$controller}`->`{$action}`",
61 61
                 ControllerException::BAD_ACTION
62 62
             );
63 63
         }
64 64
 
65
-        try {
65
+        try{
66 66
             // getting the set of arguments should be sent to requested method
67 67
             $args = $this->resolver->resolveArguments($method, $parameters);
68
-        } catch (ArgumentException $e) {
68
+        }catch (ArgumentException $e){
69 69
             throw new ControllerException(
70 70
                 "Missing/invalid parameter '{$e->getParameter()->name}' of  `{$controller}`->`{$action}`",
71 71
                 ControllerException::BAD_ARGUMENT
72 72
             );
73
-        } catch (ContainerExceptionInterface $e) {
73
+        }catch (ContainerExceptionInterface $e){
74 74
             throw new ControllerException(
75 75
                 $e->getMessage(),
76 76
                 ControllerException::ERROR,
Please login to merge, or discard this patch.
src/Router/tests/SingleActionTest.php 1 patch
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.
src/Router/tests/Diactoros/ResponseFactory.php 1 patch
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.
src/Router/tests/Diactoros/UploadedFileFactory.php 1 patch
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.
src/Router/tests/CallableTest.php 1 patch
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.
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/Route.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -59,9 +59,9 @@  discard block
 block discarded – undo
59 59
      */
60 60
     public function __construct(string $pattern, $target, array $defaults = [])
61 61
     {
62
-        if ($target instanceof TargetInterface) {
62
+        if ($target instanceof TargetInterface){
63 63
             parent::__construct($pattern, array_merge($target->getDefaults(), $defaults));
64
-        } else {
64
+        }else{
65 65
             parent::__construct($pattern, $defaults);
66 66
         }
67 67
 
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
     {
77 77
         /** @var self $route */
78 78
         $route = parent::withUriHandler($uriHandler);
79
-        if ($this->target instanceof TargetInterface) {
79
+        if ($this->target instanceof TargetInterface){
80 80
             $route->uriHandler = $route->uriHandler->withConstrains(
81 81
                 $this->target->getConstrains(),
82 82
                 $this->defaults
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
         $route = clone $this;
98 98
         $route->container = $container;
99 99
 
100
-        if ($route->target instanceof TargetInterface) {
100
+        if ($route->target instanceof TargetInterface){
101 101
             $route->target = clone $route->target;
102 102
         }
103 103
 
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
      */
115 115
     public function handle(ServerRequestInterface $request): ResponseInterface
116 116
     {
117
-        if (empty($this->requestHandler)) {
117
+        if (empty($this->requestHandler)){
118 118
             $this->requestHandler = $this->requestHandler();
119 119
         }
120 120
 
@@ -131,30 +131,30 @@  discard block
 block discarded – undo
131 131
      */
132 132
     protected function requestHandler(): RequestHandlerInterface
133 133
     {
134
-        if (!$this->hasContainer()) {
134
+        if (!$this->hasContainer()){
135 135
             throw new RouteException('Unable to configure route pipeline without associated container');
136 136
         }
137 137
 
138
-        if ($this->target instanceof TargetInterface) {
139
-            try {
138
+        if ($this->target instanceof TargetInterface){
139
+            try{
140 140
                 return $this->target->getHandler($this->container, $this->matches);
141
-            } catch (TargetException $e) {
141
+            }catch (TargetException $e){
142 142
                 throw new RouteException('Invalid target resolution', $e->getCode(), $e);
143 143
             }
144 144
         }
145 145
 
146
-        if ($this->target instanceof RequestHandlerInterface) {
146
+        if ($this->target instanceof RequestHandlerInterface){
147 147
             return $this->target;
148 148
         }
149 149
 
150
-        try {
151
-            if (is_object($this->target) || is_array($this->target)) {
150
+        try{
151
+            if (is_object($this->target) || is_array($this->target)){
152 152
                 $target = $this->target;
153
-            } else {
153
+            }else{
154 154
                 $target = $this->container->get($this->target);
155 155
             }
156 156
 
157
-            if ($target instanceof RequestHandlerInterface) {
157
+            if ($target instanceof RequestHandlerInterface){
158 158
                 return $target;
159 159
             }
160 160
 
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
                 $target,
163 163
                 $this->container->get(ResponseFactoryInterface::class)
164 164
             );
165
-        } catch (ContainerExceptionInterface $e) {
165
+        }catch (ContainerExceptionInterface $e){
166 166
             throw new RouteException($e->getMessage(), $e->getCode(), $e);
167 167
         }
168 168
     }
Please login to merge, or discard this patch.