Passed
Pull Request — master (#1095)
by Aleksei
25:10
created
src/Hmvc/tests/Core/Unit/Stub/MultipleCallNextInterceptor.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -14,13 +14,13 @@
 block discarded – undo
14 14
 
15 15
     public function __construct(
16 16
         private readonly int $counter,
17
-    ) {
17
+    ){
18 18
     }
19 19
 
20 20
     public function intercept(CallContextInterface $context, HandlerInterface $handler): mixed
21 21
     {
22 22
         $this->result = [];
23
-        for ($i = 0; $i < $this->counter; ++$i) {
23
+        for ($i = 0; $i < $this->counter; ++$i){
24 24
             $this->result[] = $handler->handle($context);
25 25
         }
26 26
 
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -20,7 +20,8 @@
 block discarded – undo
20 20
     public function intercept(CallContextInterface $context, HandlerInterface $handler): mixed
21 21
     {
22 22
         $this->result = [];
23
-        for ($i = 0; $i < $this->counter; ++$i) {
23
+        for ($i = 0; $i < $this->counter; ++$i)
24
+        {
24 25
             $this->result[] = $handler->handle($context);
25 26
         }
26 27
 
Please login to merge, or discard this patch.
src/Hmvc/src/Interceptors/Handler/ReflectionHandler.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
         /** @internal */
23 23
         protected ContainerInterface $container,
24 24
         protected bool $resolveFromPath = true,
25
-    ) {
25
+    ){
26 26
     }
27 27
 
28 28
     /**
@@ -34,14 +34,14 @@  discard block
 block discarded – undo
34 34
     {
35 35
         // Resolve controller method
36 36
         $method = $context->getTarget()->getReflection();
37
-        if ($method === null) {
37
+        if ($method === null){
38 38
             $this->resolveFromPath or throw new TargetCallException(
39 39
                 "Reflection not provided for target `{$context->getTarget()}`.",
40 40
                 TargetCallException::NOT_FOUND,
41 41
             );
42 42
 
43 43
             $path = $context->getTarget()->getPath();
44
-            if (\count($path) !== 2) {
44
+            if (\count($path) !== 2){
45 45
                 throw new TargetCallException(
46 46
                     "Invalid target path to resolve reflection for `{$context->getTarget()}`."
47 47
                     . ' Expected two parts: class and method.',
@@ -52,13 +52,13 @@  discard block
 block discarded – undo
52 52
             $method = ActionResolver::pathToReflection(\reset($path), \end($path));
53 53
         }
54 54
 
55
-        if ($method instanceof \ReflectionFunction) {
55
+        if ($method instanceof \ReflectionFunction){
56 56
             return $method->invokeArgs(
57 57
                 $this->resolveArguments($method, $context)
58 58
             );
59 59
         }
60 60
 
61
-        if (!$method instanceof \ReflectionMethod) {
61
+        if (!$method instanceof \ReflectionMethod){
62 62
             throw new TargetCallException("Action not found for target `{$context->getTarget()}`.");
63 63
         }
64 64
 
Please login to merge, or discard this patch.
Braces   +8 added lines, -4 removed lines patch added patch discarded remove patch
@@ -34,14 +34,16 @@  discard block
 block discarded – undo
34 34
     {
35 35
         // Resolve controller method
36 36
         $method = $context->getTarget()->getReflection();
37
-        if ($method === null) {
37
+        if ($method === null)
38
+        {
38 39
             $this->resolveFromPath or throw new TargetCallException(
39 40
                 "Reflection not provided for target `{$context->getTarget()}`.",
40 41
                 TargetCallException::NOT_FOUND,
41 42
             );
42 43
 
43 44
             $path = $context->getTarget()->getPath();
44
-            if (\count($path) !== 2) {
45
+            if (\count($path) !== 2)
46
+            {
45 47
                 throw new TargetCallException(
46 48
                     "Invalid target path to resolve reflection for `{$context->getTarget()}`."
47 49
                     . ' Expected two parts: class and method.',
@@ -52,13 +54,15 @@  discard block
 block discarded – undo
52 54
             $method = ActionResolver::pathToReflection(\reset($path), \end($path));
53 55
         }
54 56
 
55
-        if ($method instanceof \ReflectionFunction) {
57
+        if ($method instanceof \ReflectionFunction)
58
+        {
56 59
             return $method->invokeArgs(
57 60
                 $this->resolveArguments($method, $context)
58 61
             );
59 62
         }
60 63
 
61
-        if (!$method instanceof \ReflectionMethod) {
64
+        if (!$method instanceof \ReflectionMethod)
65
+        {
62 66
             throw new TargetCallException("Action not found for target `{$context->getTarget()}`.");
63 67
         }
64 68
 
Please login to merge, or discard this patch.