Passed
Pull Request — master (#736)
by Abdul Malik
07:17 queued 45s
created
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
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -57,12 +57,12 @@
 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
+            if (!isset($content[$i])){
62 62
                 break;
63 63
             }
64 64
 
65
-            if ($content[$i] === "\n") {
65
+            if ($content[$i] === "\n"){
66 66
                 $line++;
67 67
             }
68 68
         }
Please login to merge, or discard this patch.
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.
src/Stempler/src/Loader/StringLoader.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@
 block discarded – undo
32 32
      */
33 33
     public function load(string $path): Source
34 34
     {
35
-        if (!array_key_exists($path, $this->paths)) {
35
+        if (!array_key_exists($path, $this->paths)){
36 36
             throw new LoaderException("Unable to load path `{$path}`");
37 37
         }
38 38
 
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -32,7 +32,8 @@
 block discarded – undo
32 32
      */
33 33
     public function load(string $path): Source
34 34
     {
35
-        if (!array_key_exists($path, $this->paths)) {
35
+        if (!array_key_exists($path, $this->paths))
36
+        {
36 37
             throw new LoaderException("Unable to load path `{$path}`");
37 38
         }
38 39
 
Please login to merge, or discard this patch.
src/Stempler/src/Loader/DirectoryLoader.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@
 block discarded – undo
50 50
             $this->extension
51 51
         );
52 52
 
53
-        if (!file_exists($filename)) {
53
+        if (!file_exists($filename)){
54 54
             throw new LoaderException("Unable to load `{$path}`, no such file");
55 55
         }
56 56
 
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -50,7 +50,8 @@
 block discarded – undo
50 50
             $this->extension
51 51
         );
52 52
 
53
-        if (!file_exists($filename)) {
53
+        if (!file_exists($filename))
54
+        {
54 55
             throw new LoaderException("Unable to load `{$path}`, no such file");
55 56
         }
56 57
 
Please login to merge, or discard this patch.
src/Stempler/src/Transform/BlockFetcher.php 2 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -31,8 +31,8 @@  discard block
 block discarded – undo
31 31
     {
32 32
         $blocks = ['context' => []];
33 33
 
34
-        foreach ($caller->attrs as $attr) {
35
-            if (!$attr instanceof Attr || $attr->name instanceof NodeInterface) {
34
+        foreach ($caller->attrs as $attr){
35
+            if (!$attr instanceof Attr || $attr->name instanceof NodeInterface){
36 36
                 // ignore name when attribute is dynamic
37 37
                 $blocks[sprintf('attr-%s', count($blocks))] = $attr;
38 38
                 continue;
@@ -42,15 +42,15 @@  discard block
 block discarded – undo
42 42
             $blocks[$attr->name] = new QuotedValue($attr->value);
43 43
         }
44 44
 
45
-        foreach ($caller->nodes as $node) {
46
-            if ($node instanceof Block) {
45
+        foreach ($caller->nodes as $node){
46
+            if ($node instanceof Block){
47 47
                 $blocks[$node->name] = $node->nodes;
48
-            } else {
48
+            }else{
49 49
                 $blocks['context'][] = $node;
50 50
             }
51 51
         }
52 52
 
53
-        if ($blocks['context'] === []) {
53
+        if ($blocks['context'] === []){
54 54
             unset($blocks['context']);
55 55
         }
56 56
 
Please login to merge, or discard this patch.
Braces   +13 added lines, -6 removed lines patch added patch discarded remove patch
@@ -31,8 +31,10 @@  discard block
 block discarded – undo
31 31
     {
32 32
         $blocks = ['context' => []];
33 33
 
34
-        foreach ($caller->attrs as $attr) {
35
-            if (!$attr instanceof Attr || $attr->name instanceof NodeInterface) {
34
+        foreach ($caller->attrs as $attr)
35
+        {
36
+            if (!$attr instanceof Attr || $attr->name instanceof NodeInterface)
37
+            {
36 38
                 // ignore name when attribute is dynamic
37 39
                 $blocks[sprintf('attr-%s', count($blocks))] = $attr;
38 40
                 continue;
@@ -42,15 +44,20 @@  discard block
 block discarded – undo
42 44
             $blocks[$attr->name] = new QuotedValue($attr->value);
43 45
         }
44 46
 
45
-        foreach ($caller->nodes as $node) {
46
-            if ($node instanceof Block) {
47
+        foreach ($caller->nodes as $node)
48
+        {
49
+            if ($node instanceof Block)
50
+            {
47 51
                 $blocks[$node->name] = $node->nodes;
48
-            } else {
52
+            }
53
+            else
54
+            {
49 55
                 $blocks['context'][] = $node;
50 56
             }
51 57
         }
52 58
 
53
-        if ($blocks['context'] === []) {
59
+        if ($blocks['context'] === [])
60
+        {
54 61
             unset($blocks['context']);
55 62
         }
56 63
 
Please login to merge, or discard this patch.
src/Stempler/src/Transform/Merger.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -96,7 +96,7 @@
 block discarded – undo
96 96
     protected function traverse(array $nodes, VisitorInterface ...$visitors)
97 97
     {
98 98
         $traverser = new Traverser();
99
-        foreach ($visitors as $visitor) {
99
+        foreach ($visitors as $visitor){
100 100
             $traverser->addVisitor($visitor);
101 101
         }
102 102
 
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -96,7 +96,8 @@
 block discarded – undo
96 96
     protected function traverse(array $nodes, VisitorInterface ...$visitors)
97 97
     {
98 98
         $traverser = new Traverser();
99
-        foreach ($visitors as $visitor) {
99
+        foreach ($visitors as $visitor)
100
+        {
100 101
             $traverser->addVisitor($visitor);
101 102
         }
102 103
 
Please login to merge, or discard this patch.
src/Stempler/src/Transform/Finalizer/IsolateBlocks.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@
 block discarded – undo
36 36
      */
37 37
     public function enterNode($node, VisitorContext $ctx): void
38 38
     {
39
-        if ($node instanceof Block && $node->getContext()->getPath() === $this->path) {
39
+        if ($node instanceof Block && $node->getContext()->getPath() === $this->path){
40 40
             $node->name = null;
41 41
         }
42 42
     }
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -36,7 +36,8 @@
 block discarded – undo
36 36
      */
37 37
     public function enterNode($node, VisitorContext $ctx): void
38 38
     {
39
-        if ($node instanceof Block && $node->getContext()->getPath() === $this->path) {
39
+        if ($node instanceof Block && $node->getContext()->getPath() === $this->path)
40
+        {
40 41
             $node->name = null;
41 42
         }
42 43
     }
Please login to merge, or discard this patch.
src/Stempler/src/Transform/Finalizer/TrimRaw.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -44,9 +44,9 @@
 block discarded – undo
44 44
      */
45 45
     public function leaveNode($node, VisitorContext $ctx)
46 46
     {
47
-        if ($node instanceof Raw && trim($node->content, $this->trim) === '') {
48
-            foreach ($ctx->getScope() as $scope) {
49
-                if ($scope instanceof Attr) {
47
+        if ($node instanceof Raw && trim($node->content, $this->trim) === ''){
48
+            foreach ($ctx->getScope() as $scope){
49
+                if ($scope instanceof Attr){
50 50
                     // do not trim attribute values
51 51
                     return null;
52 52
                 }
Please login to merge, or discard this patch.
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -44,9 +44,12 @@
 block discarded – undo
44 44
      */
45 45
     public function leaveNode($node, VisitorContext $ctx)
46 46
     {
47
-        if ($node instanceof Raw && trim($node->content, $this->trim) === '') {
48
-            foreach ($ctx->getScope() as $scope) {
49
-                if ($scope instanceof Attr) {
47
+        if ($node instanceof Raw && trim($node->content, $this->trim) === '')
48
+        {
49
+            foreach ($ctx->getScope() as $scope)
50
+            {
51
+                if ($scope instanceof Attr)
52
+                {
50 53
                     // do not trim attribute values
51 54
                     return null;
52 55
                 }
Please login to merge, or discard this patch.
src/Stempler/src/Transform/Import/Element.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
         $this->path = $path;
40 40
         $this->alias = $alias ?? $path;
41 41
 
42
-        if ($alias === null && strrpos($this->alias, '/') !== false) {
42
+        if ($alias === null && strrpos($this->alias, '/') !== false){
43 43
             $this->alias = substr($this->alias, strrpos($this->alias, '/') + 1);
44 44
         }
45 45
 
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
      */
68 68
     public function resolve(Builder $builder, string $name): ?Template
69 69
     {
70
-        if ($this->alias !== $name) {
70
+        if ($this->alias !== $name){
71 71
             return null;
72 72
         }
73 73
 
Please login to merge, or discard this patch.
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -39,7 +39,8 @@  discard block
 block discarded – undo
39 39
         $this->path = $path;
40 40
         $this->alias = $alias ?? $path;
41 41
 
42
-        if ($alias === null && strrpos($this->alias, '/') !== false) {
42
+        if ($alias === null && strrpos($this->alias, '/') !== false)
43
+        {
43 44
             $this->alias = substr($this->alias, strrpos($this->alias, '/') + 1);
44 45
         }
45 46
 
@@ -67,7 +68,8 @@  discard block
 block discarded – undo
67 68
      */
68 69
     public function resolve(Builder $builder, string $name): ?Template
69 70
     {
70
-        if ($this->alias !== $name) {
71
+        if ($this->alias !== $name)
72
+        {
71 73
             return null;
72 74
         }
73 75
 
Please login to merge, or discard this patch.