Passed
Push — master ( 57f60d...31b82d )
by Aleksei
12:30
created
src/Tokenizer/src/Attribute/TargetClass.php 2 patches
Braces   +8 added lines, -4 removed lines patch added patch discarded remove patch
@@ -32,9 +32,12 @@  discard block
 block discarded – undo
32 32
     {
33 33
         $target = new \ReflectionClass($this->class);
34 34
 
35
-        foreach ($classes as $class) {
36
-            if (!$target->isTrait()) {
37
-                if ($class->isSubclassOf($target) || $class->getName() === $target->getName()) {
35
+        foreach ($classes as $class)
36
+        {
37
+            if (!$target->isTrait())
38
+            {
39
+                if ($class->isSubclassOf($target) || $class->getName() === $target->getName())
40
+                {
38 41
                     yield $class->getName();
39 42
                 }
40 43
 
@@ -42,7 +45,8 @@  discard block
 block discarded – undo
42 45
             }
43 46
 
44 47
             // Checking using traits
45
-            if (\in_array($target->getName(), $this->fetchTraits($class->getName()), true)) {
48
+            if (\in_array($target->getName(), $this->fetchTraits($class->getName()), true))
49
+            {
46 50
                 yield $class->getName();
47 51
             }
48 52
         }
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
     public function __construct(
25 25
         private readonly string $class,
26 26
         ?string $scope = null,
27
-    ) {
27
+    ){
28 28
         parent::__construct($scope);
29 29
     }
30 30
 
@@ -32,9 +32,9 @@  discard block
 block discarded – undo
32 32
     {
33 33
         $target = new \ReflectionClass($this->class);
34 34
 
35
-        foreach ($classes as $class) {
36
-            if (!$target->isTrait()) {
37
-                if ($class->isSubclassOf($target) || $class->getName() === $target->getName()) {
35
+        foreach ($classes as $class){
36
+            if (!$target->isTrait()){
37
+                if ($class->isSubclassOf($target) || $class->getName() === $target->getName()){
38 38
                     yield $class->getName();
39 39
                 }
40 40
 
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
             }
43 43
 
44 44
             // Checking using traits
45
-            if (\in_array($target->getName(), $this->fetchTraits($class->getName()), true)) {
45
+            if (\in_array($target->getName(), $this->fetchTraits($class->getName()), true)){
46 46
                 yield $class->getName();
47 47
             }
48 48
         }
Please login to merge, or discard this patch.
src/Console/src/CommandLocatorListener.php 2 patches
Braces   +8 added lines, -4 removed lines patch added patch discarded remove patch
@@ -32,7 +32,8 @@  discard block
 block discarded – undo
32 32
 
33 33
     public function listen(\ReflectionClass $class): void
34 34
     {
35
-        if (!$this->isTargeted($class, $this->target)) {
35
+        if (!$this->isTargeted($class, $this->target))
36
+        {
36 37
             return;
37 38
         }
38 39
 
@@ -41,8 +42,10 @@  discard block
 block discarded – undo
41 42
 
42 43
     public function finalize(): void
43 44
     {
44
-        foreach ($this->commands as $class) {
45
-            if ($class->isAbstract()) {
45
+        foreach ($this->commands as $class)
46
+        {
47
+            if ($class->isAbstract())
48
+            {
46 49
                 continue;
47 50
             }
48 51
 
@@ -55,7 +58,8 @@  discard block
 block discarded – undo
55 58
      */
56 59
     protected function isTargeted(\ReflectionClass $class, \ReflectionClass $target): bool
57 60
     {
58
-        if (!$target->isTrait()) {
61
+        if (!$target->isTrait())
62
+        {
59 63
             // Target is interface or class
60 64
             return $class->isSubclassOf($target) || $class->getName() === $target->getName();
61 65
         }
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -26,14 +26,14 @@  discard block
 block discarded – undo
26 26
     public function __construct(
27 27
         private readonly ConsoleBootloader $bootloader,
28 28
         ContainerInterface $container,
29
-    ) {
29
+    ){
30 30
         $this->container = $container;
31 31
         $this->target = new \ReflectionClass(SymfonyCommand::class);
32 32
     }
33 33
 
34 34
     public function listen(\ReflectionClass $class): void
35 35
     {
36
-        if (!$this->isTargeted($class, $this->target)) {
36
+        if (!$this->isTargeted($class, $this->target)){
37 37
             return;
38 38
         }
39 39
 
@@ -42,8 +42,8 @@  discard block
 block discarded – undo
42 42
 
43 43
     public function finalize(): void
44 44
     {
45
-        foreach ($this->commands as $class) {
46
-            if ($class->isAbstract()) {
45
+        foreach ($this->commands as $class){
46
+            if ($class->isAbstract()){
47 47
                 continue;
48 48
             }
49 49
 
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
      */
57 57
     protected function isTargeted(\ReflectionClass $class, \ReflectionClass $target): bool
58 58
     {
59
-        if (!$target->isTrait()) {
59
+        if (!$target->isTrait()){
60 60
             // Target is interface or class
61 61
             return $class->isSubclassOf($target) || $class->getName() === $target->getName();
62 62
         }
Please login to merge, or discard this patch.
src/Tokenizer/tests/Listener/ClassLocatorByTargetTest.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -18,8 +18,8 @@  discard block
 block discarded – undo
18 18
     use MockeryPHPUnitIntegration;
19 19
 
20 20
     private ClassLocatorByTarget $locator;
21
-    private ClassesInterface|m\LegacyMockInterface|m\MockInterface $classes;
22
-    private ScopedClassesInterface|m\LegacyMockInterface|m\MockInterface $scopedClasses;
21
+    private ClassesInterface | m\LegacyMockInterface | m\MockInterface $classes;
22
+    private ScopedClassesInterface | m\LegacyMockInterface | m\MockInterface $scopedClasses;
23 23
 
24 24
     protected function setUp(): void
25 25
     {
@@ -110,11 +110,11 @@  discard block
 block discarded – undo
110 110
         $attr = $attr->getAttributes()[0];
111 111
         $attribute = $attr->newInstance();
112 112
 
113
-        if ($attribute->getScope() === null) {
113
+        if ($attribute->getScope() === null){
114 114
             $this->classes
115 115
                 ->shouldReceive('getClasses')
116 116
                 ->andReturn($classes);
117
-        } else {
117
+        }else{
118 118
             $this->scopedClasses
119 119
                 ->shouldReceive('getScopedClasses')
120 120
                 ->with($attribute->getScope())
Please login to merge, or discard this patch.
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -110,11 +110,14 @@
 block discarded – undo
110 110
         $attr = $attr->getAttributes()[0];
111 111
         $attribute = $attr->newInstance();
112 112
 
113
-        if ($attribute->getScope() === null) {
113
+        if ($attribute->getScope() === null)
114
+        {
114 115
             $this->classes
115 116
                 ->shouldReceive('getClasses')
116 117
                 ->andReturn($classes);
117
-        } else {
118
+        }
119
+        else
120
+        {
118 121
             $this->scopedClasses
119 122
                 ->shouldReceive('getScopedClasses')
120 123
                 ->with($attribute->getScope())
Please login to merge, or discard this patch.
src/Tokenizer/tests/Classes/ClassWithAnonymousClass.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -8,7 +8,8 @@
 block discarded – undo
8 8
 {
9 9
     public function __construct()
10 10
     {
11
-        $class = new class ('foo', 'bar') {
11
+        $class = new class ('foo', 'bar')
12
+        {
12 13
             private function someFunc(): void
13 14
             {
14 15
             }
Please login to merge, or discard this patch.
src/Tokenizer/tests/Classes/ClassWithHeredoc.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -19,13 +19,13 @@
 block discarded – undo
19 19
 {
20 20
 
21 21
 }
22
-class;FOO;
22
+class; FOO;
23 23
 
24 24
         <<<'class'
25 25
 class FooBar 
26 26
 {
27 27
 
28 28
 }
29
-class ;FOO;
29
+class; FOO;
30 30
     }
31 31
 }
32 32
\ No newline at end of file
Please login to merge, or discard this patch.
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@
 block discarded – undo
11 11
     public function __construct()
12 12
     {
13 13
         <<<class
14
-FooBar
14
+foobar
15 15
 class;
16 16
 
17 17
         <<<class
Please login to merge, or discard this patch.
src/Scaffolder/tests/Command/CommandTest.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@
 block discarded – undo
24 24
             'alias' => $alias,
25 25
             '--description' => 'My sample command description',
26 26
         ];
27
-        if ($alias === null) {
27
+        if ($alias === null){
28 28
             unset($input['alias']);
29 29
         }
30 30
 
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -24,7 +24,8 @@
 block discarded – undo
24 24
             'alias' => $alias,
25 25
             '--description' => 'My sample command description',
26 26
         ];
27
-        if ($alias === null) {
27
+        if ($alias === null)
28
+        {
28 29
             unset($input['alias']);
29 30
         }
30 31
 
Please login to merge, or discard this patch.
src/Scaffolder/src/Declaration/CommandDeclaration.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
         ?string $namespace = null,
23 23
         private readonly ?string $alias = null,
24 24
         private readonly ?string $description = null,
25
-    ) {
25
+    ){
26 26
         parent::__construct($config, $name, $comment, $namespace);
27 27
     }
28 28
 
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
             'name' => $this->alias,
70 70
         ];
71 71
 
72
-        if ($this->description) {
72
+        if ($this->description){
73 73
             $commandDefinition['description'] = $this->description;
74 74
         }
75 75
 
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -69,7 +69,8 @@
 block discarded – undo
69 69
             'name' => $this->alias,
70 70
         ];
71 71
 
72
-        if ($this->description) {
72
+        if ($this->description)
73
+        {
73 74
             $commandDefinition['description'] = $this->description;
74 75
         }
75 76
 
Please login to merge, or discard this patch.
src/Scaffolder/src/Command/ControllerCommand.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -33,11 +33,11 @@
 block discarded – undo
33 33
     {
34 34
         $declaration = $this->createDeclaration(ControllerDeclaration::class);
35 35
 
36
-        foreach ($this->actions as $action) {
36
+        foreach ($this->actions as $action){
37 37
             $declaration->addAction($action);
38 38
         }
39 39
 
40
-        if ($this->usePrototype) {
40
+        if ($this->usePrototype){
41 41
             $declaration->addPrototypeTrait();
42 42
         }
43 43
 
Please login to merge, or discard this patch.
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -33,11 +33,13 @@
 block discarded – undo
33 33
     {
34 34
         $declaration = $this->createDeclaration(ControllerDeclaration::class);
35 35
 
36
-        foreach ($this->actions as $action) {
36
+        foreach ($this->actions as $action)
37
+        {
37 38
             $declaration->addAction($action);
38 39
         }
39 40
 
40
-        if ($this->usePrototype) {
41
+        if ($this->usePrototype)
42
+        {
41 43
             $declaration->addPrototypeTrait();
42 44
         }
43 45
 
Please login to merge, or discard this patch.
src/Scaffolder/src/Command/FilterCommand.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -33,11 +33,11 @@
 block discarded – undo
33 33
     {
34 34
         $declaration = $this->createDeclaration(FilterDeclaration::class);
35 35
 
36
-        foreach ($this->properties as $property) {
36
+        foreach ($this->properties as $property){
37 37
             $declaration->addProperty($property);
38 38
         }
39 39
 
40
-        if ($this->useValidator) {
40
+        if ($this->useValidator){
41 41
             $declaration->addFilterDefinition();
42 42
         }
43 43
 
Please login to merge, or discard this patch.
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -33,11 +33,13 @@
 block discarded – undo
33 33
     {
34 34
         $declaration = $this->createDeclaration(FilterDeclaration::class);
35 35
 
36
-        foreach ($this->properties as $property) {
36
+        foreach ($this->properties as $property)
37
+        {
37 38
             $declaration->addProperty($property);
38 39
         }
39 40
 
40
-        if ($this->useValidator) {
41
+        if ($this->useValidator)
42
+        {
41 43
             $declaration->addFilterDefinition();
42 44
         }
43 45
 
Please login to merge, or discard this patch.