Passed
Push — master ( 9f2c4f...e942df )
by Aleksei
17:57 queued 05:15
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
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.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
         $cd = ClassNode::create('class\name');
21 21
         $cd->constructorVars = $vars;
22 22
 
23
-        foreach (Fixtures\Params::getParams($method) as $param) {
23
+        foreach (Fixtures\Params::getParams($method) as $param){
24 24
             $cd->addParam($param);
25 25
         }
26 26
 
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
         $this->names()->resolve($cd);
29 29
 
30 30
         $resolved = [];
31
-        foreach ($cd->dependencies as $dependency) {
31
+        foreach ($cd->dependencies as $dependency){
32 32
             $resolved[] = $dependency->var;
33 33
         }
34 34
 
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
         yield [
41 41
             'paramsSource',
42 42
             [],
43
-            ['v2' => 'type1', 'v' => 'type2', 'vv' => 'type3',],
43
+            ['v2' => 'type1', 'v' => 'type2', 'vv' => 'type3', ],
44 44
             ['v2', 'v', 'vv']
45 45
         ];
46 46
         yield [
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/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
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.
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
 {
20 20
     public function setUp(): void
21 21
     {
22
-        if ((string)ini_get('zend.assertions') === 1) {
22
+        if ((string)ini_get('zend.assertions') === 1){
23 23
             ini_set('zend.assertions', 0);
24 24
         }
25 25
     }
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
     {
33 33
         $i = new Injector();
34 34
 
35
-        $filename = __DIR__ . '/Fixtures/TestClass.php';
35
+        $filename = __DIR__.'/Fixtures/TestClass.php';
36 36
         $printed = $i->injectDependencies(
37 37
             file_get_contents($filename),
38 38
             $this->getDefinition($filename, ['testClass' => TestClass::class])
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
     {
46 46
         $i = new Injector();
47 47
 
48
-        $filename = __DIR__ . '/Fixtures/WithPromotedProperty.php';
48
+        $filename = __DIR__.'/Fixtures/WithPromotedProperty.php';
49 49
         $printed = $i->injectDependencies(
50 50
             file_get_contents($filename),
51 51
             $this->getDefinition($filename, ['two' => InjectionTwo::class])
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
     {
66 66
         $i = new Injector();
67 67
 
68
-        $filename = __DIR__ . '/Fixtures/TestEmptyClass.php';
68
+        $filename = __DIR__.'/Fixtures/TestEmptyClass.php';
69 69
         $content = file_get_contents($filename);
70 70
         $printed = $i->injectDependencies(
71 71
             file_get_contents($filename),
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
     {
84 84
         $i = new Injector();
85 85
 
86
-        $filename = __DIR__ . '/Fixtures/TestClass.php';
86
+        $filename = __DIR__.'/Fixtures/TestClass.php';
87 87
         $r = $i->injectDependencies(
88 88
             file_get_contents($filename),
89 89
             $this->getDefinition($filename, ['testClass' => TestClass::class])
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
     {
109 109
         $i = new Injector();
110 110
 
111
-        $filename = __DIR__ . '/Fixtures/ChildClass.php';
111
+        $filename = __DIR__.'/Fixtures/ChildClass.php';
112 112
         $r = $i->injectDependencies(
113 113
             file_get_contents($filename),
114 114
             $this->getDefinition($filename, ['testClass' => TestClass::class])
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
     {
127 127
         $i = new Injector();
128 128
 
129
-        $filename = __DIR__ . '/Fixtures/ChildWithConstructorClass.php';
129
+        $filename = __DIR__.'/Fixtures/ChildWithConstructorClass.php';
130 130
         $r = $i->injectDependencies(
131 131
             file_get_contents($filename),
132 132
             $this->getDefinition($filename, ['testClass' => TestClass::class])
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
      */
143 143
     public function testModifyConstructor(): void
144 144
     {
145
-        $filename = __DIR__ . '/Fixtures/WithConstructor.php';
145
+        $filename = __DIR__.'/Fixtures/WithConstructor.php';
146 146
         $extractor = new Traverse\Extractor();
147 147
 
148 148
         $parameters = $extractor->extractFromFilename($filename);
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
      */
169 169
     public function testPriorOptionalConstructorParameters(): void
170 170
     {
171
-        $filename = __DIR__ . '/Fixtures/OptionalConstructorArgsClass.php';
171
+        $filename = __DIR__.'/Fixtures/OptionalConstructorArgsClass.php';
172 172
         $extractor = new Traverse\Extractor();
173 173
 
174 174
         $parameters = $extractor->extractFromFilename($filename);
@@ -199,7 +199,7 @@  discard block
 block discarded – undo
199 199
     {
200 200
         $i = new Injector();
201 201
 
202
-        $filename = __DIR__ . '/ClassNode/ConflictResolver/Fixtures/ChildClass.php';
202
+        $filename = __DIR__.'/ClassNode/ConflictResolver/Fixtures/ChildClass.php';
203 203
         $printed = $i->injectDependencies(
204 204
             file_get_contents($filename),
205 205
             $this->getDefinition(
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.
src/Stempler/src/Loader/Source.php 2 patches
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -57,12 +57,15 @@
 block discarded – undo
57 57
     {
58 58
         $line = 0;
59 59
 
60
-        for ($i = 0; $i < $offset; $i++) {
61
-            if (!isset($content[$i])) {
60
+        for ($i = 0; $i < $offset; $i++)
61
+        {
62
+            if (!isset($content[$i]))
63
+            {
62 64
                 break;
63 65
             }
64 66
 
65
-            if ($content[$i] === "\n") {
67
+            if ($content[$i] === "\n")
68
+            {
66 69
                 $line++;
67 70
             }
68 71
         }
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
     public function __construct(
13 13
         private readonly string $content,
14 14
         private readonly ?string $filename = null
15
-    ) {
15
+    ){
16 16
     }
17 17
 
18 18
     public function getContent(): string
@@ -29,12 +29,12 @@  discard block
 block discarded – undo
29 29
     {
30 30
         $line = 0;
31 31
 
32
-        for ($i = 0; $i < $offset; $i++) {
33
-            if (!isset($content[$i])) {
32
+        for ($i = 0; $i < $offset; $i++){
33
+            if (!isset($content[$i])){
34 34
                 break;
35 35
             }
36 36
 
37
-            if ($content[$i] === "\n") {
37
+            if ($content[$i] === "\n"){
38 38
                 $line++;
39 39
             }
40 40
         }
Please login to merge, or discard this patch.
src/Stempler/src/Lexer/StringStream.php 2 patches
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -53,7 +53,8 @@
 block discarded – undo
53 53
      */
54 54
     public function peak(): ?string
55 55
     {
56
-        if ($this->offset + 1 > $this->length) {
56
+        if ($this->offset + 1 > $this->length)
57
+        {
57 58
             return null;
58 59
         }
59 60
 
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
 
14 14
     public function __construct(
15 15
         private readonly string $source
16
-    ) {
16
+    ){
17 17
         $this->length = \strlen($source);
18 18
         $this->offset = 0;
19 19
     }
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
      */
34 34
     public function peak(): ?string
35 35
     {
36
-        if ($this->offset + 1 > $this->length) {
36
+        if ($this->offset + 1 > $this->length){
37 37
             return null;
38 38
         }
39 39
 
Please login to merge, or discard this patch.
src/Stempler/src/Lexer/Grammar/RawGrammar.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -27,9 +27,9 @@  discard block
 block discarded – undo
27 27
         $buffer = null;
28 28
         $bufferOffset = 0;
29 29
 
30
-        foreach ($src as $n) {
31
-            if ($n instanceof Byte) {
32
-                if ($buffer === null) {
30
+        foreach ($src as $n){
31
+            if ($n instanceof Byte){
32
+                if ($buffer === null){
33 33
                     $buffer = '';
34 34
                     $bufferOffset = $n->offset;
35 35
                 }
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
                 continue;
39 39
             }
40 40
 
41
-            if ($buffer !== null) {
41
+            if ($buffer !== null){
42 42
                 yield new Token(Token::TYPE_RAW, $bufferOffset, $buffer);
43 43
                 $buffer = null;
44 44
             }
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
             yield $n;
47 47
         }
48 48
 
49
-        if ($buffer !== null) {
49
+        if ($buffer !== null){
50 50
             yield new Token(Token::TYPE_RAW, $bufferOffset, $buffer);
51 51
         }
52 52
     }
Please login to merge, or discard this patch.
Braces   +10 added lines, -5 removed lines patch added patch discarded remove patch
@@ -27,9 +27,12 @@  discard block
 block discarded – undo
27 27
         $buffer = null;
28 28
         $bufferOffset = 0;
29 29
 
30
-        foreach ($src as $n) {
31
-            if ($n instanceof Byte) {
32
-                if ($buffer === null) {
30
+        foreach ($src as $n)
31
+        {
32
+            if ($n instanceof Byte)
33
+            {
34
+                if ($buffer === null)
35
+                {
33 36
                     $buffer = '';
34 37
                     $bufferOffset = $n->offset;
35 38
                 }
@@ -38,7 +41,8 @@  discard block
 block discarded – undo
38 41
                 continue;
39 42
             }
40 43
 
41
-            if ($buffer !== null) {
44
+            if ($buffer !== null)
45
+            {
42 46
                 yield new Token(Token::TYPE_RAW, $bufferOffset, $buffer);
43 47
                 $buffer = null;
44 48
             }
@@ -46,7 +50,8 @@  discard block
 block discarded – undo
46 50
             yield $n;
47 51
         }
48 52
 
49
-        if ($buffer !== null) {
53
+        if ($buffer !== null)
54
+        {
50 55
             yield new Token(Token::TYPE_RAW, $bufferOffset, $buffer);
51 56
         }
52 57
     }
Please login to merge, or discard this patch.