Passed
Push — master ( 3db212...288d3b )
by Aleksei
20:14 queued 09:04
created
src/Reactor/tests/Partial/PromotedParameterTest.php 1 patch
Upper-Lower-Casing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -41,38 +41,38 @@
 block discarded – undo
41 41
         $param = new PromotedParameter('test');
42 42
         $this->assertNull($param->getVisibility());
43 43
 
44
-        $param->setVisibility(Visibility::PUBLIC);
45
-        $this->assertSame(Visibility::PUBLIC, $param->getVisibility());
44
+        $param->setVisibility(Visibility::public);
45
+        $this->assertSame(Visibility::public, $param->getVisibility());
46 46
         $this->assertTrue($param->isPublic());
47 47
         $this->assertFalse($param->isProtected());
48 48
         $this->assertFalse($param->isPrivate());
49 49
 
50
-        $param->setVisibility(Visibility::PROTECTED);
51
-        $this->assertSame(Visibility::PROTECTED, $param->getVisibility());
50
+        $param->setVisibility(Visibility::protected);
51
+        $this->assertSame(Visibility::protected, $param->getVisibility());
52 52
         $this->assertFalse($param->isPublic());
53 53
         $this->assertTrue($param->isProtected());
54 54
         $this->assertFalse($param->isPrivate());
55 55
 
56
-        $param->setVisibility(Visibility::PRIVATE);
57
-        $this->assertSame(Visibility::PRIVATE, $param->getVisibility());
56
+        $param->setVisibility(Visibility::private);
57
+        $this->assertSame(Visibility::private, $param->getVisibility());
58 58
         $this->assertFalse($param->isPublic());
59 59
         $this->assertFalse($param->isProtected());
60 60
         $this->assertTrue($param->isPrivate());
61 61
 
62 62
         $param->setPublic();
63
-        $this->assertSame(Visibility::PUBLIC, $param->getVisibility());
63
+        $this->assertSame(Visibility::public, $param->getVisibility());
64 64
         $this->assertTrue($param->isPublic());
65 65
         $this->assertFalse($param->isProtected());
66 66
         $this->assertFalse($param->isPrivate());
67 67
 
68 68
         $param->setProtected();
69
-        $this->assertSame(Visibility::PROTECTED, $param->getVisibility());
69
+        $this->assertSame(Visibility::protected, $param->getVisibility());
70 70
         $this->assertFalse($param->isPublic());
71 71
         $this->assertTrue($param->isProtected());
72 72
         $this->assertFalse($param->isPrivate());
73 73
 
74 74
         $param->setPrivate();
75
-        $this->assertSame(Visibility::PRIVATE, $param->getVisibility());
75
+        $this->assertSame(Visibility::private, $param->getVisibility());
76 76
         $this->assertFalse($param->isPublic());
77 77
         $this->assertFalse($param->isProtected());
78 78
         $this->assertTrue($param->isPrivate());
Please login to merge, or discard this patch.
src/Reactor/src/Traits/FunctionLike.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
     {
58 58
         $param = Parameter::fromElement($this->element->addParameter($name));
59 59
 
60
-        if (\func_num_args() > 1) {
60
+        if (\func_num_args() > 1){
61 61
             $param->setDefaultValue($defaultValue);
62 62
         }
63 63
 
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
     {
98 98
         $type = $this->element->getReturnType(false);
99 99
 
100
-        return $type === null ? null : (string) $type;
100
+        return $type === null ? null : (string)$type;
101 101
     }
102 102
 
103 103
     public function setReturnReference(bool $state = true): static
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -57,7 +57,8 @@
 block discarded – undo
57 57
     {
58 58
         $param = Parameter::fromElement($this->element->addParameter($name));
59 59
 
60
-        if (\func_num_args() > 1) {
60
+        if (\func_num_args() > 1)
61
+        {
61 62
             $param->setDefaultValue($defaultValue);
62 63
         }
63 64
 
Please login to merge, or discard this patch.
src/Reactor/src/Traits/CommentAware.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -9,10 +9,10 @@
 block discarded – undo
9 9
  */
10 10
 trait CommentAware
11 11
 {
12
-    public function setComment(array|string|null $comment): static
12
+    public function setComment(array | string | null $comment): static
13 13
     {
14
-        if (\is_array($comment)) {
15
-            foreach ($comment as $value) {
14
+        if (\is_array($comment)){
15
+            foreach ($comment as $value){
16 16
                 $this->element->addComment($value);
17 17
             }
18 18
 
Please login to merge, or discard this patch.
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -11,8 +11,10 @@
 block discarded – undo
11 11
 {
12 12
     public function setComment(array|string|null $comment): static
13 13
     {
14
-        if (\is_array($comment)) {
15
-            foreach ($comment as $value) {
14
+        if (\is_array($comment))
15
+        {
16
+            foreach ($comment as $value)
17
+            {
16 18
                 $this->element->addComment($value);
17 19
             }
18 20
 
Please login to merge, or discard this patch.
src/Reactor/src/Traits/PropertiesAware.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@
 block discarded – undo
39 39
     /** @param string $name without $ */
40 40
     public function addProperty(string $name, mixed $value = null): Property
41 41
     {
42
-        if (\func_num_args() > 1) {
42
+        if (\func_num_args() > 1){
43 43
             return Property::fromElement($this->element->addProperty($name, $value));
44 44
         }
45 45
 
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -39,7 +39,8 @@
 block discarded – undo
39 39
     /** @param string $name without $ */
40 40
     public function addProperty(string $name, mixed $value = null): Property
41 41
     {
42
-        if (\func_num_args() > 1) {
42
+        if (\func_num_args() > 1)
43
+        {
43 44
             return Property::fromElement($this->element->addProperty($name, $value));
44 45
         }
45 46
 
Please login to merge, or discard this patch.
src/Reactor/src/Traits/VisibilityAware.php 1 patch
Upper-Lower-Casing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -25,37 +25,37 @@
 block discarded – undo
25 25
 
26 26
     public function setPublic(): static
27 27
     {
28
-        $this->setVisibility(Visibility::PUBLIC);
28
+        $this->setVisibility(Visibility::public);
29 29
 
30 30
         return $this;
31 31
     }
32 32
 
33 33
     public function isPublic(): bool
34 34
     {
35
-        return $this->getVisibility() === Visibility::PUBLIC;
35
+        return $this->getVisibility() === Visibility::public;
36 36
     }
37 37
 
38 38
     public function setProtected(): static
39 39
     {
40
-        $this->setVisibility(Visibility::PROTECTED);
40
+        $this->setVisibility(Visibility::protected);
41 41
 
42 42
         return $this;
43 43
     }
44 44
 
45 45
     public function isProtected(): bool
46 46
     {
47
-        return $this->getVisibility() === Visibility::PROTECTED;
47
+        return $this->getVisibility() === Visibility::protected;
48 48
     }
49 49
 
50 50
     public function setPrivate(): static
51 51
     {
52
-        $this->setVisibility(Visibility::PRIVATE);
52
+        $this->setVisibility(Visibility::private);
53 53
 
54 54
         return $this;
55 55
     }
56 56
 
57 57
     public function isPrivate(): bool
58 58
     {
59
-        return $this->getVisibility() === Visibility::PRIVATE;
59
+        return $this->getVisibility() === Visibility::private;
60 60
     }
61 61
 }
Please login to merge, or discard this patch.
src/Reactor/src/AbstractDeclaration.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
 
27 27
     public function setName(?string $name): self
28 28
     {
29
-        if ($name !== null) {
29
+        if ($name !== null){
30 30
             $name = (new InflectorFactory())->build()->classify($name);
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
 
27 27
     public function setName(?string $name): self
28 28
     {
29
-        if ($name !== null) {
29
+        if ($name !== null)
30
+        {
30 31
             $name = (new InflectorFactory())->build()->classify($name);
31 32
         }
32 33
 
Please login to merge, or discard this patch.
src/Reactor/src/EnumDeclaration.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
         ));
85 85
     }
86 86
 
87
-    public function addCase(string $name, string|int|null $value = null): EnumCase
87
+    public function addCase(string $name, string | int | null $value = null): EnumCase
88 88
     {
89 89
         return EnumCase::fromElement($this->element->addCase($name, $value));
90 90
     }
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
         return $this;
102 102
     }
103 103
 
104
-    public function addMember(Method|Constant|EnumCase|TraitUse $member): static
104
+    public function addMember(Method | Constant | EnumCase | TraitUse $member): static
105 105
     {
106 106
         $this->element->addMember($member->getElement());
107 107
 
Please login to merge, or discard this patch.
src/Reactor/src/ClassDeclaration.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -89,7 +89,7 @@
 block discarded – undo
89 89
         return $this;
90 90
     }
91 91
 
92
-    public function addMember(Method|Property|Constant|TraitUse $member): static
92
+    public function addMember(Method | Property | Constant | TraitUse $member): static
93 93
     {
94 94
         $this->element->addMember($member->getElement());
95 95
 
Please login to merge, or discard this patch.
src/Reactor/src/InterfaceDeclaration.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
         $this->element = new InterfaceType($name);
20 20
     }
21 21
 
22
-    public function setExtends(string|array $names): static
22
+    public function setExtends(string | array $names): static
23 23
     {
24 24
         $this->element->setExtends($names);
25 25
 
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
         return $this;
40 40
     }
41 41
 
42
-    public function addMember(Method|Constant $member): static
42
+    public function addMember(Method | Constant $member): static
43 43
     {
44 44
         $this->element->addMember($member->getElement());
45 45
 
Please login to merge, or discard this patch.