Passed
Pull Request — master (#1190)
by Aleksei
20:19 queued 07:41
created
src/Prototype/tests/ClassNode/ConflictResolver/ConflictResolverTest.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
     {
22 22
         $i = new Injector();
23 23
 
24
-        $filename = __DIR__ . '/Fixtures/TestClass.php';
24
+        $filename = __DIR__.'/Fixtures/TestClass.php';
25 25
         $r = $i->injectDependencies(
26 26
             file_get_contents($filename),
27 27
             $this->getDefinition(
@@ -34,10 +34,10 @@  discard block
 block discarded – undo
34 34
             )
35 35
         );
36 36
 
37
-        self::assertStringContainsString(Fixtures\Some::class . ';', $r);
38
-        self::assertStringContainsString(Fixtures\SubFolder\Some::class . ' as Some2;', $r);
39
-        self::assertStringNotContainsString(Fixtures\SubFolder\Some::class . ';', $r);
40
-        self::assertStringContainsString(Fixtures\ATest3::class . ';', $r);
37
+        self::assertStringContainsString(Fixtures\Some::class.';', $r);
38
+        self::assertStringContainsString(Fixtures\SubFolder\Some::class.' as Some2;', $r);
39
+        self::assertStringNotContainsString(Fixtures\SubFolder\Some::class.';', $r);
40
+        self::assertStringContainsString(Fixtures\ATest3::class.';', $r);
41 41
     }
42 42
 
43 43
     /**
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
     {
48 48
         $i = new Injector();
49 49
 
50
-        $filename = __DIR__ . '/Fixtures/TestClassWithImports.php';
50
+        $filename = __DIR__.'/Fixtures/TestClassWithImports.php';
51 51
         $r = $i->injectDependencies(
52 52
             file_get_contents($filename),
53 53
             $this->getDefinition(
@@ -60,12 +60,12 @@  discard block
 block discarded – undo
60 60
             )
61 61
         );
62 62
 
63
-        self::assertStringContainsString(Fixtures\Some::class . ' as FTest;', $r);
64
-        self::assertStringNotContainsString(Fixtures\Some::class . ';', $r);
65
-        self::assertStringContainsString(Fixtures\SubFolder\Some::class . ' as TestAlias;', $r);
66
-        self::assertStringNotContainsString(Fixtures\SubFolder\Some::class . ';', $r);
67
-        self::assertStringContainsString(Fixtures\ATest3::class . ' as ATest;', $r);
68
-        self::assertStringNotContainsString(Fixtures\ATest3::class . ';', $r);
63
+        self::assertStringContainsString(Fixtures\Some::class.' as FTest;', $r);
64
+        self::assertStringNotContainsString(Fixtures\Some::class.';', $r);
65
+        self::assertStringContainsString(Fixtures\SubFolder\Some::class.' as TestAlias;', $r);
66
+        self::assertStringNotContainsString(Fixtures\SubFolder\Some::class.';', $r);
67
+        self::assertStringContainsString(Fixtures\ATest3::class.' as ATest;', $r);
68
+        self::assertStringNotContainsString(Fixtures\ATest3::class.';', $r);
69 69
     }
70 70
 
71 71
     /**
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
     {
76 76
         $i = new Injector();
77 77
 
78
-        $filename = __DIR__ . '/Fixtures/ChildClass.php';
78
+        $filename = __DIR__.'/Fixtures/ChildClass.php';
79 79
         $r = $i->injectDependencies(
80 80
             file_get_contents($filename),
81 81
             $this->getDefinition(
@@ -88,18 +88,18 @@  discard block
 block discarded – undo
88 88
             )
89 89
         );
90 90
 
91
-        self::assertStringContainsString(Fixtures\Some::class . ';', $r);
92
-        self::assertStringContainsString(Fixtures\SubFolder\Some::class . ' as Some2;', $r);
93
-        self::assertStringNotContainsString(Fixtures\SubFolder\Some::class . ';', $r);
94
-        self::assertStringContainsString(Fixtures\ATest3::class . ' as ATestAlias;', $r);
95
-        self::assertStringNotContainsString(Fixtures\ATest3::class . ';', $r);
91
+        self::assertStringContainsString(Fixtures\Some::class.';', $r);
92
+        self::assertStringContainsString(Fixtures\SubFolder\Some::class.' as Some2;', $r);
93
+        self::assertStringNotContainsString(Fixtures\SubFolder\Some::class.';', $r);
94
+        self::assertStringContainsString(Fixtures\ATest3::class.' as ATestAlias;', $r);
95
+        self::assertStringNotContainsString(Fixtures\ATest3::class.';', $r);
96 96
     }
97 97
 
98 98
     public function testDuplicateProperty(): void
99 99
     {
100 100
         $i = new Injector();
101 101
 
102
-        $filename = __DIR__ . '/Fixtures/DuplicatePropertyClass.php';
102
+        $filename = __DIR__.'/Fixtures/DuplicatePropertyClass.php';
103 103
         $r = $i->injectDependencies(
104 104
             file_get_contents($filename),
105 105
             $this->getDefinition(
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
             )
111 111
         );
112 112
 
113
-        self::assertStringContainsString(Fixtures\Some::class . ';', $r);
113
+        self::assertStringContainsString(Fixtures\Some::class.';', $r);
114 114
         self::assertStringContainsString('__construct(private readonly Some $test)', $r);
115 115
     }
116 116
 
Please login to merge, or discard this patch.
src/Prototype/tests/Commands/InjectCommandTest.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
         $source = file_get_contents($filename);
35 35
         self::assertStringContainsString('use PrototypeTrait;', $source);
36 36
 
37
-        try {
37
+        try{
38 38
             $this->app->bindApp();
39 39
 
40 40
             $inp = new ArrayInput(['--remove' => true]);
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
             $this->app->get(Console::class)->run('prototype:inject', $inp, $out);
43 43
 
44 44
             self::assertStringNotContainsString('use PrototypeTrait;', file_get_contents($filename));
45
-        } finally {
45
+        }finally{
46 46
             file_put_contents($filename, $source);
47 47
         }
48 48
     }
Please login to merge, or discard this patch.
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -34,7 +34,8 @@  discard block
 block discarded – undo
34 34
         $source = file_get_contents($filename);
35 35
         self::assertStringContainsString('use PrototypeTrait;', $source);
36 36
 
37
-        try {
37
+        try
38
+        {
38 39
             $this->app->bindApp();
39 40
 
40 41
             $inp = new ArrayInput(['--remove' => true]);
@@ -42,7 +43,9 @@  discard block
 block discarded – undo
42 43
             $this->app->get(Console::class)->run('prototype:inject', $inp, $out);
43 44
 
44 45
             self::assertStringNotContainsString('use PrototypeTrait;', file_get_contents($filename));
45
-        } finally {
46
+        }
47
+        finally
48
+        {
46 49
             file_put_contents($filename, $source);
47 50
         }
48 51
     }
Please login to merge, or discard this patch.
src/Prototype/tests/ExtractorTest.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
         $e = new PropertyExtractor();
15 15
 
16 16
         $expected = ['test', 'test2', 'test3', 'testClass'];
17
-        $prototypes = $e->getPrototypeProperties(file_get_contents(__DIR__ . '/Fixtures/TestClass.php'));
17
+        $prototypes = $e->getPrototypeProperties(file_get_contents(__DIR__.'/Fixtures/TestClass.php'));
18 18
         sort($prototypes);
19 19
         self::assertSame($expected, $prototypes);
20 20
     }
@@ -22,6 +22,6 @@  discard block
 block discarded – undo
22 22
     public function testExtractNone(): void
23 23
     {
24 24
         $e = new PropertyExtractor();
25
-        self::assertSame([], $e->getPrototypeProperties(file_get_contents(__DIR__ . '/Fixtures/HydratedClass.php')));
25
+        self::assertSame([], $e->getPrototypeProperties(file_get_contents(__DIR__.'/Fixtures/HydratedClass.php')));
26 26
     }
27 27
 }
Please login to merge, or discard this patch.
src/Reactor/tests/FileDeclarationTest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -142,7 +142,7 @@
 block discarded – undo
142 142
         $file->addUse('Foo\\Bar');
143 143
         $file->addClass('Test')->addImplement('Foo\\Bar');
144 144
 
145
-        self::assertStringContainsString('use Foo\\Bar;', (string) $file);
145
+        self::assertStringContainsString('use Foo\\Bar;', (string)$file);
146 146
     }
147 147
 
148 148
     public function testStrictTypes(): void
Please login to merge, or discard this patch.
src/Reactor/tests/Partial/MethodTest.php 1 patch
Upper-Lower-Casing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -133,38 +133,38 @@
 block discarded – undo
133 133
         $method = new Method('test');
134 134
         self::assertNull($method->getVisibility());
135 135
 
136
-        $method->setVisibility(Visibility::PUBLIC);
137
-        self::assertSame(Visibility::PUBLIC, $method->getVisibility());
136
+        $method->setVisibility(Visibility::public);
137
+        self::assertSame(Visibility::public, $method->getVisibility());
138 138
         self::assertTrue($method->isPublic());
139 139
         self::assertFalse($method->isProtected());
140 140
         self::assertFalse($method->isPrivate());
141 141
 
142
-        $method->setVisibility(Visibility::PROTECTED);
143
-        self::assertSame(Visibility::PROTECTED, $method->getVisibility());
142
+        $method->setVisibility(Visibility::protected);
143
+        self::assertSame(Visibility::protected, $method->getVisibility());
144 144
         self::assertFalse($method->isPublic());
145 145
         self::assertTrue($method->isProtected());
146 146
         self::assertFalse($method->isPrivate());
147 147
 
148
-        $method->setVisibility(Visibility::PRIVATE);
149
-        self::assertSame(Visibility::PRIVATE, $method->getVisibility());
148
+        $method->setVisibility(Visibility::private);
149
+        self::assertSame(Visibility::private, $method->getVisibility());
150 150
         self::assertFalse($method->isPublic());
151 151
         self::assertFalse($method->isProtected());
152 152
         self::assertTrue($method->isPrivate());
153 153
 
154 154
         $method->setPublic();
155
-        self::assertSame(Visibility::PUBLIC, $method->getVisibility());
155
+        self::assertSame(Visibility::public, $method->getVisibility());
156 156
         self::assertTrue($method->isPublic());
157 157
         self::assertFalse($method->isProtected());
158 158
         self::assertFalse($method->isPrivate());
159 159
 
160 160
         $method->setProtected();
161
-        self::assertSame(Visibility::PROTECTED, $method->getVisibility());
161
+        self::assertSame(Visibility::protected, $method->getVisibility());
162 162
         self::assertFalse($method->isPublic());
163 163
         self::assertTrue($method->isProtected());
164 164
         self::assertFalse($method->isPrivate());
165 165
 
166 166
         $method->setPrivate();
167
-        self::assertSame(Visibility::PRIVATE, $method->getVisibility());
167
+        self::assertSame(Visibility::private, $method->getVisibility());
168 168
         self::assertFalse($method->isPublic());
169 169
         self::assertFalse($method->isProtected());
170 170
         self::assertTrue($method->isPrivate());
Please login to merge, or discard this patch.
src/Reactor/tests/Partial/PromotedParameterTest.php 1 patch
Upper-Lower-Casing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -35,38 +35,38 @@
 block discarded – undo
35 35
         $param = new PromotedParameter('test');
36 36
         self::assertNull($param->getVisibility());
37 37
 
38
-        $param->setVisibility(Visibility::PUBLIC);
39
-        self::assertSame(Visibility::PUBLIC, $param->getVisibility());
38
+        $param->setVisibility(Visibility::public);
39
+        self::assertSame(Visibility::public, $param->getVisibility());
40 40
         self::assertTrue($param->isPublic());
41 41
         self::assertFalse($param->isProtected());
42 42
         self::assertFalse($param->isPrivate());
43 43
 
44
-        $param->setVisibility(Visibility::PROTECTED);
45
-        self::assertSame(Visibility::PROTECTED, $param->getVisibility());
44
+        $param->setVisibility(Visibility::protected);
45
+        self::assertSame(Visibility::protected, $param->getVisibility());
46 46
         self::assertFalse($param->isPublic());
47 47
         self::assertTrue($param->isProtected());
48 48
         self::assertFalse($param->isPrivate());
49 49
 
50
-        $param->setVisibility(Visibility::PRIVATE);
51
-        self::assertSame(Visibility::PRIVATE, $param->getVisibility());
50
+        $param->setVisibility(Visibility::private);
51
+        self::assertSame(Visibility::private, $param->getVisibility());
52 52
         self::assertFalse($param->isPublic());
53 53
         self::assertFalse($param->isProtected());
54 54
         self::assertTrue($param->isPrivate());
55 55
 
56 56
         $param->setPublic();
57
-        self::assertSame(Visibility::PUBLIC, $param->getVisibility());
57
+        self::assertSame(Visibility::public, $param->getVisibility());
58 58
         self::assertTrue($param->isPublic());
59 59
         self::assertFalse($param->isProtected());
60 60
         self::assertFalse($param->isPrivate());
61 61
 
62 62
         $param->setProtected();
63
-        self::assertSame(Visibility::PROTECTED, $param->getVisibility());
63
+        self::assertSame(Visibility::protected, $param->getVisibility());
64 64
         self::assertFalse($param->isPublic());
65 65
         self::assertTrue($param->isProtected());
66 66
         self::assertFalse($param->isPrivate());
67 67
 
68 68
         $param->setPrivate();
69
-        self::assertSame(Visibility::PRIVATE, $param->getVisibility());
69
+        self::assertSame(Visibility::private, $param->getVisibility());
70 70
         self::assertFalse($param->isPublic());
71 71
         self::assertFalse($param->isProtected());
72 72
         self::assertTrue($param->isPrivate());
Please login to merge, or discard this patch.
src/Reactor/tests/Partial/PropertyTest.php 1 patch
Upper-Lower-Casing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -59,38 +59,38 @@
 block discarded – undo
59 59
         $property = new Property('foo');
60 60
         self::assertNull($property->getVisibility());
61 61
 
62
-        $property->setVisibility(Visibility::PUBLIC);
63
-        self::assertSame(Visibility::PUBLIC, $property->getVisibility());
62
+        $property->setVisibility(Visibility::public);
63
+        self::assertSame(Visibility::public, $property->getVisibility());
64 64
         self::assertTrue($property->isPublic());
65 65
         self::assertFalse($property->isProtected());
66 66
         self::assertFalse($property->isPrivate());
67 67
 
68
-        $property->setVisibility(Visibility::PROTECTED);
69
-        self::assertSame(Visibility::PROTECTED, $property->getVisibility());
68
+        $property->setVisibility(Visibility::protected);
69
+        self::assertSame(Visibility::protected, $property->getVisibility());
70 70
         self::assertFalse($property->isPublic());
71 71
         self::assertTrue($property->isProtected());
72 72
         self::assertFalse($property->isPrivate());
73 73
 
74
-        $property->setVisibility(Visibility::PRIVATE);
75
-        self::assertSame(Visibility::PRIVATE, $property->getVisibility());
74
+        $property->setVisibility(Visibility::private);
75
+        self::assertSame(Visibility::private, $property->getVisibility());
76 76
         self::assertFalse($property->isPublic());
77 77
         self::assertFalse($property->isProtected());
78 78
         self::assertTrue($property->isPrivate());
79 79
 
80 80
         $property->setPublic();
81
-        self::assertSame(Visibility::PUBLIC, $property->getVisibility());
81
+        self::assertSame(Visibility::public, $property->getVisibility());
82 82
         self::assertTrue($property->isPublic());
83 83
         self::assertFalse($property->isProtected());
84 84
         self::assertFalse($property->isPrivate());
85 85
 
86 86
         $property->setProtected();
87
-        self::assertSame(Visibility::PROTECTED, $property->getVisibility());
87
+        self::assertSame(Visibility::protected, $property->getVisibility());
88 88
         self::assertFalse($property->isPublic());
89 89
         self::assertTrue($property->isProtected());
90 90
         self::assertFalse($property->isPrivate());
91 91
 
92 92
         $property->setPrivate();
93
-        self::assertSame(Visibility::PRIVATE, $property->getVisibility());
93
+        self::assertSame(Visibility::private, $property->getVisibility());
94 94
         self::assertFalse($property->isPublic());
95 95
         self::assertFalse($property->isProtected());
96 96
         self::assertTrue($property->isPrivate());
Please login to merge, or discard this patch.
src/Bridge/Dotenv/src/Bootloader/DotenvBootloader.php 2 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -22,22 +22,22 @@
 block discarded – undo
22 22
 
23 23
     public function loadEnvVariables(DirectoriesInterface $dirs, EnvironmentInterface $env): void
24 24
     {
25
-        if ($this->init) {
25
+        if ($this->init){
26 26
             return;
27 27
         }
28 28
 
29 29
         $this->init = true;
30 30
 
31
-        $dotenvPath = $env->get('DOTENV_PATH', $dirs->get('root') . '.env');
31
+        $dotenvPath = $env->get('DOTENV_PATH', $dirs->get('root').'.env');
32 32
 
33
-        if (!\file_exists($dotenvPath)) {
33
+        if (!\file_exists($dotenvPath)){
34 34
             return;
35 35
         }
36 36
 
37
-        $path = \dirname((string) $dotenvPath);
38
-        $file = \basename((string) $dotenvPath);
37
+        $path = \dirname((string)$dotenvPath);
38
+        $file = \basename((string)$dotenvPath);
39 39
 
40
-        foreach (Dotenv::createImmutable($path, $file)->load() as $key => $value) {
40
+        foreach (Dotenv::createImmutable($path, $file)->load() as $key => $value){
41 41
             $env->set($key, $value);
42 42
         }
43 43
     }
Please login to merge, or discard this patch.
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -22,7 +22,8 @@  discard block
 block discarded – undo
22 22
 
23 23
     public function loadEnvVariables(DirectoriesInterface $dirs, EnvironmentInterface $env): void
24 24
     {
25
-        if ($this->init) {
25
+        if ($this->init)
26
+        {
26 27
             return;
27 28
         }
28 29
 
@@ -30,14 +31,16 @@  discard block
 block discarded – undo
30 31
 
31 32
         $dotenvPath = $env->get('DOTENV_PATH', $dirs->get('root') . '.env');
32 33
 
33
-        if (!\file_exists($dotenvPath)) {
34
+        if (!\file_exists($dotenvPath))
35
+        {
34 36
             return;
35 37
         }
36 38
 
37 39
         $path = \dirname((string) $dotenvPath);
38 40
         $file = \basename((string) $dotenvPath);
39 41
 
40
-        foreach (Dotenv::createImmutable($path, $file)->load() as $key => $value) {
42
+        foreach (Dotenv::createImmutable($path, $file)->load() as $key => $value)
43
+        {
41 44
             $env->set($key, $value);
42 45
         }
43 46
     }
Please login to merge, or discard this patch.
src/Bridge/Stempler/tests/EngineTest.php 2 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -43,10 +43,10 @@  discard block
 block discarded – undo
43 43
     {
44 44
         $s = $this->getStempler();
45 45
 
46
-        try {
46
+        try{
47 47
             $s->get('echo', new ViewContext())->render();
48 48
             $this->fail('Exception expected');
49
-        } catch (RenderException $e) {
49
+        }catch (RenderException $e){
50 50
             $t = $e->getUserTrace()[0];
51 51
 
52 52
             self::assertSame(2, $t['line']);
@@ -58,10 +58,10 @@  discard block
 block discarded – undo
58 58
     {
59 59
         $s = $this->getStempler();
60 60
 
61
-        try {
61
+        try{
62 62
             $s->get('other:echo-in', new ViewContext())->render();
63 63
             $this->fail('Exception expected');
64
-        } catch (RenderException $e) {
64
+        }catch (RenderException $e){
65 65
             $t = $e->getUserTrace();
66 66
             self::assertCount(2, $t);
67 67
 
@@ -77,9 +77,9 @@  discard block
 block discarded – undo
77 77
     {
78 78
         $twig = $this->getStempler();
79 79
 
80
-        try {
80
+        try{
81 81
             $twig->get('other:bad', new ViewContext());
82
-        } catch (CompileException $e) {
82
+        }catch (CompileException $e){
83 83
             self::assertStringContainsString('bad.dark.php', $e->getFile());
84 84
         }
85 85
     }
Please login to merge, or discard this patch.
Braces   +15 added lines, -6 removed lines patch added patch discarded remove patch
@@ -43,10 +43,13 @@  discard block
 block discarded – undo
43 43
     {
44 44
         $s = $this->getStempler();
45 45
 
46
-        try {
46
+        try
47
+        {
47 48
             $s->get('echo', new ViewContext())->render();
48 49
             $this->fail('Exception expected');
49
-        } catch (RenderException $e) {
50
+        }
51
+        catch (RenderException $e)
52
+        {
50 53
             $t = $e->getUserTrace()[0];
51 54
 
52 55
             self::assertSame(2, $t['line']);
@@ -58,10 +61,13 @@  discard block
 block discarded – undo
58 61
     {
59 62
         $s = $this->getStempler();
60 63
 
61
-        try {
64
+        try
65
+        {
62 66
             $s->get('other:echo-in', new ViewContext())->render();
63 67
             $this->fail('Exception expected');
64
-        } catch (RenderException $e) {
68
+        }
69
+        catch (RenderException $e)
70
+        {
65 71
             $t = $e->getUserTrace();
66 72
             self::assertCount(2, $t);
67 73
 
@@ -77,9 +83,12 @@  discard block
 block discarded – undo
77 83
     {
78 84
         $twig = $this->getStempler();
79 85
 
80
-        try {
86
+        try
87
+        {
81 88
             $twig->get('other:bad', new ViewContext());
82
-        } catch (CompileException $e) {
89
+        }
90
+        catch (CompileException $e)
91
+        {
83 92
             self::assertStringContainsString('bad.dark.php', $e->getFile());
84 93
         }
85 94
     }
Please login to merge, or discard this patch.