Passed
Pull Request — master (#298)
by Valentin
04:51
created
src/Prototype/tests/ClassNode/ConflictResolver/Fixtures/Params.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -13,12 +13,12 @@
 block discarded – undo
13 13
      */
14 14
     public static function getParams(string $method): array
15 15
     {
16
-        try {
16
+        try{
17 17
             $rc = new \ReflectionClass(self::class);
18 18
             $method = $rc->getMethod($method);
19 19
 
20 20
             return $method->getParameters();
21
-        } catch (\ReflectionException $e) {
21
+        }catch (\ReflectionException $e){
22 22
             return [];
23 23
         }
24 24
     }
Please login to merge, or discard this patch.
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -13,12 +13,15 @@
 block discarded – undo
13 13
      */
14 14
     public static function getParams(string $method): array
15 15
     {
16
-        try {
16
+        try
17
+        {
17 18
             $rc = new \ReflectionClass(self::class);
18 19
             $method = $rc->getMethod($method);
19 20
 
20 21
             return $method->getParameters();
21
-        } catch (\ReflectionException $e) {
22
+        }
23
+        catch (\ReflectionException $e)
24
+        {
22 25
             return [];
23 26
         }
24 27
     }
Please login to merge, or discard this patch.
src/Prototype/tests/ClassNode/ConflictResolver/NamesTest.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
         $cd = ClassNode::create('class\name');
28 28
         $cd->constructorVars = $vars;
29 29
 
30
-        foreach (Fixtures\Params::getParams($method) as $param) {
30
+        foreach (Fixtures\Params::getParams($method) as $param){
31 31
             $cd->addParam($param);
32 32
         }
33 33
 
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
         $this->names()->resolve($cd);
36 36
 
37 37
         $resolved = [];
38
-        foreach ($cd->dependencies as $dependency) {
38
+        foreach ($cd->dependencies as $dependency){
39 39
             $resolved[] = $dependency->var;
40 40
         }
41 41
 
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
             [
49 49
                 'paramsSource',
50 50
                 [],
51
-                ['v2' => 'type1', 'v' => 'type2', 'vv' => 'type3',],
51
+                ['v2' => 'type1', 'v' => 'type2', 'vv' => 'type3', ],
52 52
                 ['v2', 'v', 'vv']
53 53
             ],
54 54
             [
Please login to merge, or discard this patch.
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -27,7 +27,8 @@  discard block
 block discarded – undo
27 27
         $cd = ClassNode::create('class\name');
28 28
         $cd->constructorVars = $vars;
29 29
 
30
-        foreach (Fixtures\Params::getParams($method) as $param) {
30
+        foreach (Fixtures\Params::getParams($method) as $param)
31
+        {
31 32
             $cd->addParam($param);
32 33
         }
33 34
 
@@ -35,7 +36,8 @@  discard block
 block discarded – undo
35 36
         $this->names()->resolve($cd);
36 37
 
37 38
         $resolved = [];
38
-        foreach ($cd->dependencies as $dependency) {
39
+        foreach ($cd->dependencies as $dependency)
40
+        {
39 41
             $resolved[] = $dependency->var;
40 42
         }
41 43
 
Please login to merge, or discard this patch.
src/Prototype/tests/ClassNode/ConflictResolver/NamespacesTest.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -25,11 +25,11 @@  discard block
 block discarded – undo
25 25
     {
26 26
         $cd = ClassNode::create('class\name');
27 27
 
28
-        foreach ($stmts as $alias => $name) {
28
+        foreach ($stmts as $alias => $name){
29 29
             $cd->addImportUsage($name, $alias);
30 30
         }
31 31
 
32
-        foreach (Fixtures\Params::getParams('paramsSource') as $param) {
32
+        foreach (Fixtures\Params::getParams('paramsSource') as $param){
33 33
             $cd->addParam($param);
34 34
         }
35 35
 
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
         $this->namespaces()->resolve($cd);
38 38
 
39 39
         $resolved = [];
40
-        foreach ($cd->dependencies as $dependency) {
40
+        foreach ($cd->dependencies as $dependency){
41 41
             $resolved[$dependency->property] = $dependency->type->getAliasOrShortName();
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
@@ -25,11 +25,13 @@  discard block
 block discarded – undo
25 25
     {
26 26
         $cd = ClassNode::create('class\name');
27 27
 
28
-        foreach ($stmts as $alias => $name) {
28
+        foreach ($stmts as $alias => $name)
29
+        {
29 30
             $cd->addImportUsage($name, $alias);
30 31
         }
31 32
 
32
-        foreach (Fixtures\Params::getParams('paramsSource') as $param) {
33
+        foreach (Fixtures\Params::getParams('paramsSource') as $param)
34
+        {
33 35
             $cd->addParam($param);
34 36
         }
35 37
 
@@ -37,7 +39,8 @@  discard block
 block discarded – undo
37 39
         $this->namespaces()->resolve($cd);
38 40
 
39 41
         $resolved = [];
40
-        foreach ($cd->dependencies as $dependency) {
42
+        foreach ($cd->dependencies as $dependency)
43
+        {
41 44
             $resolved[$dependency->property] = $dependency->type->getAliasOrShortName();
42 45
         }
43 46
 
Please login to merge, or discard this patch.
src/Prototype/tests/TraitTest.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -64,7 +64,8 @@
 block discarded – undo
64 64
         $c->bindSingleton(TestClass::class, $t);
65 65
         $p->bindProperty('testClass', TestClass::class);
66 66
 
67
-        $r = ContainerScope::runScope($c, static function () use ($t) {
67
+        $r = ContainerScope::runScope($c, static function () use ($t)
68
+        {
68 69
             return $t->getTest();
69 70
         });
70 71
 
Please login to merge, or discard this patch.
src/Prototype/tests/LocatorTest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@
 block discarded – undo
40 40
     private function makeClasses(): ClassesInterface
41 41
     {
42 42
         return new ClassLocator(
43
-            (new Finder())->in([__DIR__ . '/Fixtures'])->files()
43
+            (new Finder())->in([__DIR__.'/Fixtures'])->files()
44 44
         );
45 45
     }
46 46
 }
Please login to merge, or discard this patch.
src/Prototype/tests/Fixtures/Dependencies.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@
 block discarded – undo
18 18
     public static function convert(array $deps): array
19 19
     {
20 20
         $converted = [];
21
-        foreach ($deps as $name => $type) {
21
+        foreach ($deps as $name => $type){
22 22
             $converted[$name] = Dependency::create($name, $type);
23 23
         }
24 24
 
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -18,7 +18,8 @@
 block discarded – undo
18 18
     public static function convert(array $deps): array
19 19
     {
20 20
         $converted = [];
21
-        foreach ($deps as $name => $type) {
21
+        foreach ($deps as $name => $type)
22
+        {
22 23
             $converted[$name] = Dependency::create($name, $type);
23 24
         }
24 25
 
Please login to merge, or discard this patch.
src/Prototype/tests/InjectorTest.php 2 patches
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
 {
25 25
     public function setUp(): void
26 26
     {
27
-        if ((string)ini_get('zend.assertions') === 1) {
27
+        if ((string)ini_get('zend.assertions') === 1){
28 28
             ini_set('zend.assertions', 0);
29 29
         }
30 30
     }
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
     {
38 38
         $i = new Injector();
39 39
 
40
-        $filename = __DIR__ . '/Fixtures/TestClass.php';
40
+        $filename = __DIR__.'/Fixtures/TestClass.php';
41 41
         $printed = $i->injectDependencies(
42 42
             file_get_contents($filename),
43 43
             $this->getDefinition($filename, ['testClass' => TestClass::class])
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
     {
55 55
         $i = new Injector();
56 56
 
57
-        $filename = __DIR__ . '/Fixtures/TestEmptyClass.php';
57
+        $filename = __DIR__.'/Fixtures/TestEmptyClass.php';
58 58
         $content = file_get_contents($filename);
59 59
         $printed = $i->injectDependencies(
60 60
             file_get_contents($filename),
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
     {
73 73
         $i = new Injector();
74 74
 
75
-        $filename = __DIR__ . '/Fixtures/TestClass.php';
75
+        $filename = __DIR__.'/Fixtures/TestClass.php';
76 76
         $r = $i->injectDependencies(
77 77
             file_get_contents($filename),
78 78
             $this->getDefinition($filename, ['testClass' => TestClass::class])
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
     {
98 98
         $i = new Injector();
99 99
 
100
-        $filename = __DIR__ . '/Fixtures/ChildClass.php';
100
+        $filename = __DIR__.'/Fixtures/ChildClass.php';
101 101
         $r = $i->injectDependencies(
102 102
             file_get_contents($filename),
103 103
             $this->getDefinition($filename, ['testClass' => TestClass::class])
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
     {
116 116
         $i = new Injector();
117 117
 
118
-        $filename = __DIR__ . '/Fixtures/ChildWithConstructorClass.php';
118
+        $filename = __DIR__.'/Fixtures/ChildWithConstructorClass.php';
119 119
         $r = $i->injectDependencies(
120 120
             file_get_contents($filename),
121 121
             $this->getDefinition($filename, ['testClass' => TestClass::class])
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
      */
132 132
     public function testModifyConstructor(): void
133 133
     {
134
-        $filename = __DIR__ . '/Fixtures/WithConstructor.php';
134
+        $filename = __DIR__.'/Fixtures/WithConstructor.php';
135 135
         $traverser = new Traverse\Extractor();
136 136
 
137 137
         $parameters = $traverser->extractFromFilename($filename);
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
      */
158 158
     public function testPriorOptionalConstructorParameters(): void
159 159
     {
160
-        $filename = __DIR__ . '/Fixtures/OptionalConstructorArgsClass.php';
160
+        $filename = __DIR__.'/Fixtures/OptionalConstructorArgsClass.php';
161 161
         $traverser = new Traverse\Extractor();
162 162
 
163 163
         $parameters = $traverser->extractFromFilename($filename);
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
     {
189 189
         $i = new Injector();
190 190
 
191
-        $filename = __DIR__ . '/ClassNode/ConflictResolver/Fixtures/ChildClass.php';
191
+        $filename = __DIR__.'/ClassNode/ConflictResolver/Fixtures/ChildClass.php';
192 192
         $printed = $i->injectDependencies(
193 193
             file_get_contents($filename),
194 194
             $this->getDefinition($filename, [
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
 {
25 25
     public function setUp(): void
26 26
     {
27
-        if ((string)ini_get('zend.assertions') === 1) {
27
+        if ((string)ini_get('zend.assertions') === 1)
28
+        {
28 29
             ini_set('zend.assertions', 0);
29 30
         }
30 31
     }
Please login to merge, or discard this patch.
src/Prototype/tests/UtilsTest.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -31,9 +31,9 @@
 block discarded – undo
31 31
     public function trailingProvider(): array
32 32
     {
33 33
         return [
34
-            ['name7', 7, 'name',],
35
-            ['name', 0, 'name',],
36
-            ['name0', 0, 'name',],
34
+            ['name7', 7, 'name', ],
35
+            ['name', 0, 'name', ],
36
+            ['name0', 0, 'name', ],
37 37
             ['name1', 1, 'name'],
38 38
             ['name-1', 1, 'name-'],
39 39
             ['name-1', -1, 'name'],
Please login to merge, or discard this patch.
src/Prototype/tests/Storage.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -26,11 +26,11 @@
 block discarded – undo
26 26
 
27 27
     public function store(string $name): void
28 28
     {
29
-        $this->storage[$name] = file_get_contents($this->dir . $name);
29
+        $this->storage[$name] = file_get_contents($this->dir.$name);
30 30
     }
31 31
 
32 32
     public function restore(string $name): void
33 33
     {
34
-        file_put_contents($this->dir . $name, $this->storage[$name]);
34
+        file_put_contents($this->dir.$name, $this->storage[$name]);
35 35
     }
36 36
 }
Please login to merge, or discard this patch.