Test Failed
Pull Request — master (#1170)
by Aleksei
19:12 queued 08:18
created
src/Queue/src/QueueRegistry.php 2 patches
Spacing   +12 added lines, -14 removed lines patch added patch discarded remove patch
@@ -26,13 +26,13 @@  discard block
 block discarded – undo
26 26
         private readonly ContainerInterface $container,
27 27
         private readonly FactoryInterface $factory,
28 28
         private readonly HandlerRegistryInterface $fallbackHandlers
29
-    ) {
29
+    ){
30 30
     }
31 31
 
32 32
     /**
33 33
      * Associate specific job type with handler class or object
34 34
      */
35
-    public function setHandler(string $jobType, HandlerInterface|string $handler): void
35
+    public function setHandler(string $jobType, HandlerInterface | string $handler): void
36 36
     {
37 37
         $this->handlers[$jobType] = $handler;
38 38
     }
@@ -43,8 +43,8 @@  discard block
 block discarded – undo
43 43
      */
44 44
     public function getHandler(string $jobType): HandlerInterface
45 45
     {
46
-        if (isset($this->handlers[$jobType])) {
47
-            if ($this->handlers[$jobType] instanceof HandlerInterface) {
46
+        if (isset($this->handlers[$jobType])){
47
+            if ($this->handlers[$jobType] instanceof HandlerInterface){
48 48
                 return $this->handlers[$jobType];
49 49
             }
50 50
 
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
      *
62 62
      * @throws InvalidArgumentException
63 63
      */
64
-    public function setSerializer(string $jobType, SerializerInterface|string|Autowire $serializer): void
64
+    public function setSerializer(string $jobType, SerializerInterface | string | Autowire $serializer): void
65 65
     {
66 66
         $this->serializers[$jobType] = $this->resolveSerializer($serializer);
67 67
     }
@@ -71,15 +71,14 @@  discard block
 block discarded – undo
71 71
      */
72 72
     public function getSerializer(?string $jobType = null): SerializerInterface
73 73
     {
74
-        if ($jobType && $this->hasSerializer($jobType)) {
74
+        if ($jobType && $this->hasSerializer($jobType)){
75 75
             return $this->serializers[$jobType];
76 76
         }
77 77
 
78 78
         $config = $this->container->get(QueueConfig::class);
79 79
 
80 80
         return $config->getDefaultSerializer() === null ?
81
-            $this->container->get(SerializerManager::class)->getSerializer() :
82
-            $this->resolveSerializer($config->getDefaultSerializer());
81
+            $this->container->get(SerializerManager::class)->getSerializer() : $this->resolveSerializer($config->getDefaultSerializer());
83 82
     }
84 83
 
85 84
     public function hasSerializer(string $jobType): bool
@@ -92,22 +91,21 @@  discard block
 block discarded – undo
92 91
      *
93 92
      * @throws InvalidArgumentException
94 93
      */
95
-    private function resolveSerializer(SerializerInterface|string|Autowire $serializer): SerializerInterface
94
+    private function resolveSerializer(SerializerInterface | string | Autowire $serializer): SerializerInterface
96 95
     {
97
-        if ($serializer instanceof Autowire) {
96
+        if ($serializer instanceof Autowire){
98 97
             $serializer = $serializer->resolve($this->factory);
99 98
         }
100 99
 
101
-        if (\is_string($serializer)) {
100
+        if (\is_string($serializer)){
102 101
             $registry = $this->container->get(SerializerRegistryInterface::class);
103 102
             \assert($registry instanceof SerializerRegistryInterface);
104 103
 
105 104
             $serializer = $registry->has($serializer) ?
106
-                $registry->get($serializer) :
107
-                $this->container->get($serializer);
105
+                $registry->get($serializer) : $this->container->get($serializer);
108 106
         }
109 107
 
110
-        if (!$serializer instanceof SerializerInterface) {
108
+        if (!$serializer instanceof SerializerInterface){
111 109
             throw new InvalidArgumentException(\sprintf(
112 110
                 'Serializer must be an instance of `SerializerInterface` but `%s` given.',
113 111
                 \get_debug_type($serializer)
Please login to merge, or discard this patch.
Braces   +12 added lines, -6 removed lines patch added patch discarded remove patch
@@ -43,8 +43,10 @@  discard block
 block discarded – undo
43 43
      */
44 44
     public function getHandler(string $jobType): HandlerInterface
45 45
     {
46
-        if (isset($this->handlers[$jobType])) {
47
-            if ($this->handlers[$jobType] instanceof HandlerInterface) {
46
+        if (isset($this->handlers[$jobType]))
47
+        {
48
+            if ($this->handlers[$jobType] instanceof HandlerInterface)
49
+            {
48 50
                 return $this->handlers[$jobType];
49 51
             }
50 52
 
@@ -71,7 +73,8 @@  discard block
 block discarded – undo
71 73
      */
72 74
     public function getSerializer(?string $jobType = null): SerializerInterface
73 75
     {
74
-        if ($jobType && $this->hasSerializer($jobType)) {
76
+        if ($jobType && $this->hasSerializer($jobType))
77
+        {
75 78
             return $this->serializers[$jobType];
76 79
         }
77 80
 
@@ -94,11 +97,13 @@  discard block
 block discarded – undo
94 97
      */
95 98
     private function resolveSerializer(SerializerInterface|string|Autowire $serializer): SerializerInterface
96 99
     {
97
-        if ($serializer instanceof Autowire) {
100
+        if ($serializer instanceof Autowire)
101
+        {
98 102
             $serializer = $serializer->resolve($this->factory);
99 103
         }
100 104
 
101
-        if (\is_string($serializer)) {
105
+        if (\is_string($serializer))
106
+        {
102 107
             $registry = $this->container->get(SerializerRegistryInterface::class);
103 108
             \assert($registry instanceof SerializerRegistryInterface);
104 109
 
@@ -107,7 +112,8 @@  discard block
 block discarded – undo
107 112
                 $this->container->get($serializer);
108 113
         }
109 114
 
110
-        if (!$serializer instanceof SerializerInterface) {
115
+        if (!$serializer instanceof SerializerInterface)
116
+        {
111 117
             throw new InvalidArgumentException(\sprintf(
112 118
                 'Serializer must be an instance of `SerializerInterface` but `%s` given.',
113 119
                 \get_debug_type($serializer)
Please login to merge, or discard this patch.
src/Queue/src/ContainerRegistry.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -16,19 +16,19 @@
 block discarded – undo
16 16
 
17 17
     public function __construct(
18 18
         private readonly ContainerInterface $container
19
-    ) {
19
+    ){
20 20
         $this->inflector = (new InflectorFactory())->build();
21 21
     }
22 22
 
23 23
     public function getHandler(string $jobType): HandlerInterface
24 24
     {
25
-        try {
25
+        try{
26 26
             $handler = $this->container->get($this->className($jobType));
27
-        } catch (ContainerException $e) {
27
+        }catch (ContainerException $e){
28 28
             throw new JobException($e->getMessage(), $e->getCode(), $e);
29 29
         }
30 30
 
31
-        if (!$handler instanceof HandlerInterface) {
31
+        if (!$handler instanceof HandlerInterface){
32 32
             throw new JobException(\sprintf('Unable to resolve job handler for `%s`', $jobType));
33 33
         }
34 34
 
Please login to merge, or discard this patch.
Braces   +7 added lines, -3 removed lines patch added patch discarded remove patch
@@ -22,13 +22,17 @@
 block discarded – undo
22 22
 
23 23
     public function getHandler(string $jobType): HandlerInterface
24 24
     {
25
-        try {
25
+        try
26
+        {
26 27
             $handler = $this->container->get($this->className($jobType));
27
-        } catch (ContainerException $e) {
28
+        }
29
+        catch (ContainerException $e)
30
+        {
28 31
             throw new JobException($e->getMessage(), $e->getCode(), $e);
29 32
         }
30 33
 
31
-        if (!$handler instanceof HandlerInterface) {
34
+        if (!$handler instanceof HandlerInterface)
35
+        {
32 36
             throw new JobException(\sprintf('Unable to resolve job handler for `%s`', $jobType));
33 37
         }
34 38
 
Please login to merge, or discard this patch.
src/Queue/src/Interceptor/Consume/Core.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@
 block discarded – undo
23 23
     public function __construct(
24 24
         private readonly HandlerRegistryInterface $registry,
25 25
         private readonly ?EventDispatcherInterface $dispatcher = null
26
-    ) {
26
+    ){
27 27
     }
28 28
 
29 29
     /**
Please login to merge, or discard this patch.
src/Prototype/src/PrototypeLocator.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@
 block discarded – undo
11 11
 {
12 12
     public function __construct(
13 13
         private readonly ScopedClassesInterface $classes
14
-    ) {
14
+    ){
15 15
     }
16 16
 
17 17
     /**
Please login to merge, or discard this patch.
src/Prototype/src/NodeExtractor.php 2 patches
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
         private readonly ConflictResolver\Names $namesResolver,
26 26
         private readonly ConflictResolver\Namespaces $namespacesResolver,
27 27
         Parser $parser = null
28
-    ) {
28
+    ){
29 29
         $this->parser = $parser ?? (new ParserFactory())->create(ParserFactory::ONLY_PHP7);
30 30
     }
31 31
 
@@ -58,11 +58,11 @@  discard block
 block discarded – undo
58 58
         $declarator = new DeclareClass();
59 59
         $this->traverse($filename, $declarator);
60 60
 
61
-        if (empty($declarator->getClass())) {
61
+        if (empty($declarator->getClass())){
62 62
             throw new ClassNotDeclaredException($filename);
63 63
         }
64 64
 
65
-        if ($declarator->getNamespace()) {
65
+        if ($declarator->getNamespace()){
66 66
             return ClassNode::createWithNamespace($declarator->getClass(), $declarator->getNamespace());
67 67
         }
68 68
 
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
     {
74 74
         $tr = new NodeTraverser();
75 75
 
76
-        foreach ($visitors as $visitor) {
76
+        foreach ($visitors as $visitor){
77 77
             $tr->addVisitor($visitor);
78 78
         }
79 79
 
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
 
83 83
     private function fillStmts(ClassNode $definition, array $imports): void
84 84
     {
85
-        foreach ($imports as $import) {
85
+        foreach ($imports as $import){
86 86
             $definition->addImportUsage($import['name'], $import['alias']);
87 87
         }
88 88
     }
@@ -95,10 +95,10 @@  discard block
 block discarded – undo
95 95
         $reflection = new \ReflectionClass(\sprintf('%s\%s', $definition->namespace, $definition->class));
96 96
 
97 97
         $constructor = $reflection->getConstructor();
98
-        if ($constructor !== null) {
98
+        if ($constructor !== null){
99 99
             $definition->hasConstructor = $constructor->getDeclaringClass()->getName() === $reflection->getName();
100 100
 
101
-            foreach ($reflection->getConstructor()->getParameters() as $parameter) {
101
+            foreach ($reflection->getConstructor()->getParameters() as $parameter){
102 102
                 $definition->addParam($parameter);
103 103
             }
104 104
         }
@@ -110,8 +110,8 @@  discard block
 block discarded – undo
110 110
      */
111 111
     private function fillConstructorVars(array $vars, ClassNode $definition): void
112 112
     {
113
-        foreach ($vars as $k => $var) {
114
-            if (isset($definition->constructorParams[$var])) {
113
+        foreach ($vars as $k => $var){
114
+            if (isset($definition->constructorParams[$var])){
115 115
                 unset($vars[$k]);
116 116
             }
117 117
         }
Please login to merge, or discard this patch.
Braces   +16 added lines, -8 removed lines patch added patch discarded remove patch
@@ -58,11 +58,13 @@  discard block
 block discarded – undo
58 58
         $declarator = new DeclareClass();
59 59
         $this->traverse($filename, $declarator);
60 60
 
61
-        if (empty($declarator->getClass())) {
61
+        if (empty($declarator->getClass()))
62
+        {
62 63
             throw new ClassNotDeclaredException($filename);
63 64
         }
64 65
 
65
-        if ($declarator->getNamespace()) {
66
+        if ($declarator->getNamespace())
67
+        {
66 68
             return ClassNode::createWithNamespace($declarator->getClass(), $declarator->getNamespace());
67 69
         }
68 70
 
@@ -73,7 +75,8 @@  discard block
 block discarded – undo
73 75
     {
74 76
         $tr = new NodeTraverser();
75 77
 
76
-        foreach ($visitors as $visitor) {
78
+        foreach ($visitors as $visitor)
79
+        {
77 80
             $tr->addVisitor($visitor);
78 81
         }
79 82
 
@@ -82,7 +85,8 @@  discard block
 block discarded – undo
82 85
 
83 86
     private function fillStmts(ClassNode $definition, array $imports): void
84 87
     {
85
-        foreach ($imports as $import) {
88
+        foreach ($imports as $import)
89
+        {
86 90
             $definition->addImportUsage($import['name'], $import['alias']);
87 91
         }
88 92
     }
@@ -95,10 +99,12 @@  discard block
 block discarded – undo
95 99
         $reflection = new \ReflectionClass(\sprintf('%s\%s', $definition->namespace, $definition->class));
96 100
 
97 101
         $constructor = $reflection->getConstructor();
98
-        if ($constructor !== null) {
102
+        if ($constructor !== null)
103
+        {
99 104
             $definition->hasConstructor = $constructor->getDeclaringClass()->getName() === $reflection->getName();
100 105
 
101
-            foreach ($reflection->getConstructor()->getParameters() as $parameter) {
106
+            foreach ($reflection->getConstructor()->getParameters() as $parameter)
107
+            {
102 108
                 $definition->addParam($parameter);
103 109
             }
104 110
         }
@@ -110,8 +116,10 @@  discard block
 block discarded – undo
110 116
      */
111 117
     private function fillConstructorVars(array $vars, ClassNode $definition): void
112 118
     {
113
-        foreach ($vars as $k => $var) {
114
-            if (isset($definition->constructorParams[$var])) {
119
+        foreach ($vars as $k => $var)
120
+        {
121
+            if (isset($definition->constructorParams[$var]))
122
+            {
115 123
                 unset($vars[$k]);
116 124
             }
117 125
         }
Please login to merge, or discard this patch.
src/Prototype/src/Utils.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
     public static function shortName(string $name): string
21 21
     {
22 22
         $pos = \mb_strrpos($name, '\\');
23
-        if ($pos === false) {
23
+        if ($pos === false){
24 24
             return $name;
25 25
         }
26 26
 
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
     public static function trimTrailingDigits(string $name, int $number): string
45 45
     {
46 46
         $pos = \mb_strripos($name, (string)$number);
47
-        if ($pos === false) {
47
+        if ($pos === false){
48 48
             return $name;
49 49
         }
50 50
 
Please login to merge, or discard this patch.
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -20,7 +20,8 @@  discard block
 block discarded – undo
20 20
     public static function shortName(string $name): string
21 21
     {
22 22
         $pos = \mb_strrpos($name, '\\');
23
-        if ($pos === false) {
23
+        if ($pos === false)
24
+        {
24 25
             return $name;
25 26
         }
26 27
 
@@ -44,7 +45,8 @@  discard block
 block discarded – undo
44 45
     public static function trimTrailingDigits(string $name, int $number): string
45 46
     {
46 47
         $pos = \mb_strripos($name, (string)$number);
47
-        if ($pos === false) {
48
+        if ($pos === false)
49
+        {
48 50
             return $name;
49 51
         }
50 52
 
Please login to merge, or discard this patch.
src/Prototype/src/NodeVisitors/AddUse.php 2 patches
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -20,21 +20,21 @@  discard block
 block discarded – undo
20 20
 
21 21
     public function __construct(
22 22
         private readonly ClassNode $node
23
-    ) {
23
+    ){
24 24
     }
25 25
 
26 26
     public function leaveNode(Node $node): ?Node
27 27
     {
28
-        if (!$node instanceof Node\Stmt\Namespace_) {
28
+        if (!$node instanceof Node\Stmt\Namespace_){
29 29
             return null;
30 30
         }
31 31
 
32 32
         $imported = [];
33
-        if (!$this->node->hasConstructor && $this->node->constructorParams) {
34
-            foreach ($this->node->constructorParams as $param) {
35
-                if (!empty($param->type) && $param->type->fullName) {
33
+        if (!$this->node->hasConstructor && $this->node->constructorParams){
34
+            foreach ($this->node->constructorParams as $param){
35
+                if (!empty($param->type) && $param->type->fullName){
36 36
                     $import = [$param->type->fullName, $param->type->alias];
37
-                    if (\in_array($import, $imported, true)) {
37
+                    if (\in_array($import, $imported, true)){
38 38
                         continue;
39 39
                     }
40 40
 
@@ -44,9 +44,9 @@  discard block
 block discarded – undo
44 44
             }
45 45
         }
46 46
 
47
-        foreach ($this->node->dependencies as $dependency) {
47
+        foreach ($this->node->dependencies as $dependency){
48 48
             $import = [$dependency->type->fullName, $dependency->type->alias];
49
-            if (\in_array($import, $imported, true)) {
49
+            if (\in_array($import, $imported, true)){
50 50
                 continue;
51 51
             }
52 52
 
@@ -69,8 +69,8 @@  discard block
 block discarded – undo
69 69
 
70 70
     private function definePlacementID(Node\Stmt\Namespace_ $node): int
71 71
     {
72
-        foreach ($node->stmts as $index => $child) {
73
-            if ($child instanceof Node\Stmt\Class_) {
72
+        foreach ($node->stmts as $index => $child){
73
+            if ($child instanceof Node\Stmt\Class_){
74 74
                 return $index;
75 75
             }
76 76
         }
@@ -87,13 +87,13 @@  discard block
 block discarded – undo
87 87
     {
88 88
         $uses = $this->getExistingUseParts($stmts);
89 89
 
90
-        foreach ($nodes as $i => $node) {
91
-            if (!$node instanceof Node\Stmt\Use_) {
90
+        foreach ($nodes as $i => $node){
91
+            if (!$node instanceof Node\Stmt\Use_){
92 92
                 continue;
93 93
             }
94 94
 
95
-            foreach ($node->uses as $use) {
96
-                if (\in_array($use->name->parts, $uses, true)) {
95
+            foreach ($node->uses as $use){
96
+                if (\in_array($use->name->parts, $uses, true)){
97 97
                     unset($nodes[$i]);
98 98
                 }
99 99
             }
@@ -112,12 +112,12 @@  discard block
 block discarded – undo
112 112
     private function getExistingUseParts(array $stmts): array
113 113
     {
114 114
         $uses = [];
115
-        foreach ($stmts as $stmt) {
116
-            if (!$stmt instanceof Node\Stmt\Use_) {
115
+        foreach ($stmts as $stmt){
116
+            if (!$stmt instanceof Node\Stmt\Use_){
117 117
                 continue;
118 118
             }
119 119
 
120
-            foreach ($stmt->uses as $use) {
120
+            foreach ($stmt->uses as $use){
121 121
                 $uses[] = $use->name->parts;
122 122
             }
123 123
         }
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
     private function buildUse(string $type, ?string $alias = null): Node\Stmt\Use_
129 129
     {
130 130
         $b = new Use_(new Node\Name($type), Node\Stmt\Use_::TYPE_NORMAL);
131
-        if (!empty($alias)) {
131
+        if (!empty($alias)){
132 132
             $b->as($alias);
133 133
         }
134 134
 
Please login to merge, or discard this patch.
Braces   +34 added lines, -17 removed lines patch added patch discarded remove patch
@@ -25,16 +25,21 @@  discard block
 block discarded – undo
25 25
 
26 26
     public function leaveNode(Node $node): ?Node
27 27
     {
28
-        if (!$node instanceof Node\Stmt\Namespace_) {
28
+        if (!$node instanceof Node\Stmt\Namespace_)
29
+        {
29 30
             return null;
30 31
         }
31 32
 
32 33
         $imported = [];
33
-        if (!$this->node->hasConstructor && $this->node->constructorParams) {
34
-            foreach ($this->node->constructorParams as $param) {
35
-                if (!empty($param->type) && $param->type->fullName) {
34
+        if (!$this->node->hasConstructor && $this->node->constructorParams)
35
+        {
36
+            foreach ($this->node->constructorParams as $param)
37
+            {
38
+                if (!empty($param->type) && $param->type->fullName)
39
+                {
36 40
                     $import = [$param->type->fullName, $param->type->alias];
37
-                    if (\in_array($import, $imported, true)) {
41
+                    if (\in_array($import, $imported, true))
42
+                    {
38 43
                         continue;
39 44
                     }
40 45
 
@@ -44,9 +49,11 @@  discard block
 block discarded – undo
44 49
             }
45 50
         }
46 51
 
47
-        foreach ($this->node->dependencies as $dependency) {
52
+        foreach ($this->node->dependencies as $dependency)
53
+        {
48 54
             $import = [$dependency->type->fullName, $dependency->type->alias];
49
-            if (\in_array($import, $imported, true)) {
55
+            if (\in_array($import, $imported, true))
56
+            {
50 57
                 continue;
51 58
             }
52 59
 
@@ -69,8 +76,10 @@  discard block
 block discarded – undo
69 76
 
70 77
     private function definePlacementID(Node\Stmt\Namespace_ $node): int
71 78
     {
72
-        foreach ($node->stmts as $index => $child) {
73
-            if ($child instanceof Node\Stmt\Class_) {
79
+        foreach ($node->stmts as $index => $child)
80
+        {
81
+            if ($child instanceof Node\Stmt\Class_)
82
+            {
74 83
                 return $index;
75 84
             }
76 85
         }
@@ -87,13 +96,17 @@  discard block
 block discarded – undo
87 96
     {
88 97
         $uses = $this->getExistingUseParts($stmts);
89 98
 
90
-        foreach ($nodes as $i => $node) {
91
-            if (!$node instanceof Node\Stmt\Use_) {
99
+        foreach ($nodes as $i => $node)
100
+        {
101
+            if (!$node instanceof Node\Stmt\Use_)
102
+            {
92 103
                 continue;
93 104
             }
94 105
 
95
-            foreach ($node->uses as $use) {
96
-                if (\in_array($use->name->parts, $uses, true)) {
106
+            foreach ($node->uses as $use)
107
+            {
108
+                if (\in_array($use->name->parts, $uses, true))
109
+                {
97 110
                     unset($nodes[$i]);
98 111
                 }
99 112
             }
@@ -112,12 +125,15 @@  discard block
 block discarded – undo
112 125
     private function getExistingUseParts(array $stmts): array
113 126
     {
114 127
         $uses = [];
115
-        foreach ($stmts as $stmt) {
116
-            if (!$stmt instanceof Node\Stmt\Use_) {
128
+        foreach ($stmts as $stmt)
129
+        {
130
+            if (!$stmt instanceof Node\Stmt\Use_)
131
+            {
117 132
                 continue;
118 133
             }
119 134
 
120
-            foreach ($stmt->uses as $use) {
135
+            foreach ($stmt->uses as $use)
136
+            {
121 137
                 $uses[] = $use->name->parts;
122 138
             }
123 139
         }
@@ -128,7 +144,8 @@  discard block
 block discarded – undo
128 144
     private function buildUse(string $type, ?string $alias = null): Node\Stmt\Use_
129 145
     {
130 146
         $b = new Use_(new Node\Name($type), Node\Stmt\Use_::TYPE_NORMAL);
131
-        if (!empty($alias)) {
147
+        if (!empty($alias))
148
+        {
132 149
             $b->as($alias);
133 150
         }
134 151
 
Please login to merge, or discard this patch.
src/Prototype/src/NodeVisitors/DefineConstructor.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -16,15 +16,15 @@
 block discarded – undo
16 16
 {
17 17
     public function leaveNode(Node $node): ?Node
18 18
     {
19
-        if (!$node instanceof Node\Stmt\Class_) {
19
+        if (!$node instanceof Node\Stmt\Class_){
20 20
             return null;
21 21
         }
22 22
 
23 23
         $placementID = 0;
24
-        foreach ($node->stmts as $index => $child) {
24
+        foreach ($node->stmts as $index => $child){
25 25
             $placementID = $index;
26
-            if ($child instanceof Node\Stmt\ClassMethod) {
27
-                if ($child->name->name === '__construct') {
26
+            if ($child instanceof Node\Stmt\ClassMethod){
27
+                if ($child->name->name === '__construct'){
28 28
                     $node->setAttribute('constructor', $child);
29 29
 
30 30
                     return null;
Please login to merge, or discard this patch.
Braces   +8 added lines, -4 removed lines patch added patch discarded remove patch
@@ -16,15 +16,19 @@
 block discarded – undo
16 16
 {
17 17
     public function leaveNode(Node $node): ?Node
18 18
     {
19
-        if (!$node instanceof Node\Stmt\Class_) {
19
+        if (!$node instanceof Node\Stmt\Class_)
20
+        {
20 21
             return null;
21 22
         }
22 23
 
23 24
         $placementID = 0;
24
-        foreach ($node->stmts as $index => $child) {
25
+        foreach ($node->stmts as $index => $child)
26
+        {
25 27
             $placementID = $index;
26
-            if ($child instanceof Node\Stmt\ClassMethod) {
27
-                if ($child->name->name === '__construct') {
28
+            if ($child instanceof Node\Stmt\ClassMethod)
29
+            {
30
+                if ($child->name->name === '__construct')
31
+                {
28 32
                     $node->setAttribute('constructor', $child);
29 33
 
30 34
                     return null;
Please login to merge, or discard this patch.
src/Prototype/src/NodeVisitors/ClassNode/LocateVariables.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -12,18 +12,18 @@
 block discarded – undo
12 12
 {
13 13
     private array $vars = [];
14 14
 
15
-    public function enterNode(Node $node): int|Node\Stmt\ClassMethod|null
15
+    public function enterNode(Node $node): int | Node\Stmt\ClassMethod | null
16 16
     {
17
-        if ($node instanceof Node\Stmt\Class_) {
18
-            foreach ($node->stmts as $stmt) {
19
-                if ($stmt instanceof Node\Stmt\ClassMethod && $stmt->name === '__construct') {
17
+        if ($node instanceof Node\Stmt\Class_){
18
+            foreach ($node->stmts as $stmt){
19
+                if ($stmt instanceof Node\Stmt\ClassMethod && $stmt->name === '__construct'){
20 20
                     return $stmt;
21 21
                 }
22 22
             }
23 23
             return NodeTraverser::DONT_TRAVERSE_CHILDREN;
24 24
         }
25 25
 
26
-        if ($node instanceof Node\Expr\Variable) {
26
+        if ($node instanceof Node\Expr\Variable){
27 27
             $this->vars[] = $node->name;
28 28
         }
29 29
 
Please login to merge, or discard this patch.
Braces   +8 added lines, -4 removed lines patch added patch discarded remove patch
@@ -14,16 +14,20 @@
 block discarded – undo
14 14
 
15 15
     public function enterNode(Node $node): int|Node\Stmt\ClassMethod|null
16 16
     {
17
-        if ($node instanceof Node\Stmt\Class_) {
18
-            foreach ($node->stmts as $stmt) {
19
-                if ($stmt instanceof Node\Stmt\ClassMethod && $stmt->name === '__construct') {
17
+        if ($node instanceof Node\Stmt\Class_)
18
+        {
19
+            foreach ($node->stmts as $stmt)
20
+            {
21
+                if ($stmt instanceof Node\Stmt\ClassMethod && $stmt->name === '__construct')
22
+                {
20 23
                     return $stmt;
21 24
                 }
22 25
             }
23 26
             return NodeTraverser::DONT_TRAVERSE_CHILDREN;
24 27
         }
25 28
 
26
-        if ($node instanceof Node\Expr\Variable) {
29
+        if ($node instanceof Node\Expr\Variable)
30
+        {
27 31
             $this->vars[] = $node->name;
28 32
         }
29 33
 
Please login to merge, or discard this patch.