Passed
Push — master ( 48358c...5b4064 )
by Valentin
13:24 queued 08:47
created
src/Stempler/src/Transform/Visitor/DefineHidden.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@
 block discarded – undo
33 33
      */
34 34
     public function leaveNode($node, VisitorContext $ctx)
35 35
     {
36
-        if ($node instanceof Tag && strpos($node->name, $this->hiddenKeyword) === 0) {
36
+        if ($node instanceof Tag && strpos($node->name, $this->hiddenKeyword) === 0){
37 37
             return new Hidden([$node]);
38 38
         }
39 39
 
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -33,7 +33,8 @@
 block discarded – undo
33 33
      */
34 34
     public function leaveNode($node, VisitorContext $ctx)
35 35
     {
36
-        if ($node instanceof Tag && strpos($node->name, $this->hiddenKeyword) === 0) {
36
+        if ($node instanceof Tag && strpos($node->name, $this->hiddenKeyword) === 0)
37
+        {
37 38
             return new Hidden([$node]);
38 39
         }
39 40
 
Please login to merge, or discard this patch.
src/Stempler/src/Compiler/Renderer/PHPRenderer.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@
 block discarded – undo
23 23
      */
24 24
     public function render(Compiler $compiler, Compiler\Result $result, NodeInterface $node): bool
25 25
     {
26
-        if ($node instanceof PHP) {
26
+        if ($node instanceof PHP){
27 27
             $result->push($node->content, $node->getContext());
28 28
             return true;
29 29
         }
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,7 +23,8 @@
 block discarded – undo
23 23
      */
24 24
     public function render(Compiler $compiler, Compiler\Result $result, NodeInterface $node): bool
25 25
     {
26
-        if ($node instanceof PHP) {
26
+        if ($node instanceof PHP)
27
+        {
27 28
             $result->push($node->content, $node->getContext());
28 29
             return true;
29 30
         }
Please login to merge, or discard this patch.
src/Stempler/src/Compiler/Renderer/HTMLRenderer.php 2 patches
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
      */
28 28
     public function render(Compiler $compiler, Compiler\Result $result, NodeInterface $node): bool
29 29
     {
30
-        switch (true) {
30
+        switch (true){
31 31
             case $node instanceof Tag:
32 32
                 $this->tag($compiler, $result, $node);
33 33
                 return true;
@@ -51,8 +51,8 @@  discard block
 block discarded – undo
51 51
     {
52 52
         $result->push(sprintf('<%s', $node->name), $node->getContext());
53 53
 
54
-        foreach ($node->attrs as $attr) {
55
-            if (!$attr instanceof Attribute) {
54
+        foreach ($node->attrs as $attr){
55
+            if (!$attr instanceof Attribute){
56 56
                 $compiler->compile($attr, $result);
57 57
                 continue;
58 58
             }
@@ -62,11 +62,11 @@  discard block
 block discarded – undo
62 62
 
63 63
         $result->push(sprintf('%s>', $node->void ? '/' : ''), null);
64 64
 
65
-        foreach ($node->nodes as $child) {
65
+        foreach ($node->nodes as $child){
66 66
             $compiler->compile($child, $result);
67 67
         }
68 68
 
69
-        if (!$node->void) {
69
+        if (!$node->void){
70 70
             $result->push(sprintf('</%s>', $node->name), null);
71 71
         }
72 72
     }
@@ -78,19 +78,19 @@  discard block
 block discarded – undo
78 78
      */
79 79
     private function attribute(Compiler $compiler, Compiler\Result $result, Attr $node): void
80 80
     {
81
-        if ($node->name instanceof NodeInterface) {
81
+        if ($node->name instanceof NodeInterface){
82 82
             $result->push(' ', null);
83 83
             $compiler->compile($node->name, $result);
84
-        } else {
84
+        }else{
85 85
             $result->push(sprintf(' %s', $node->name), $node->getContext());
86 86
         }
87 87
 
88 88
         $value = $node->value;
89
-        if ($value instanceof Nil) {
89
+        if ($value instanceof Nil){
90 90
             return;
91 91
         }
92 92
 
93
-        if ($value instanceof NodeInterface) {
93
+        if ($value instanceof NodeInterface){
94 94
             $result->push('=', null);
95 95
             $compiler->compile($value, $result);
96 96
             return;
@@ -106,8 +106,8 @@  discard block
 block discarded – undo
106 106
      */
107 107
     private function verbatim(Compiler $compiler, Compiler\Result $result, Verbatim $node): void
108 108
     {
109
-        foreach ($node->nodes as $child) {
110
-            if (is_string($child)) {
109
+        foreach ($node->nodes as $child){
110
+            if (is_string($child)){
111 111
                 $result->push($child, null);
112 112
                 continue;
113 113
             }
Please login to merge, or discard this patch.
Braces   +23 added lines, -11 removed lines patch added patch discarded remove patch
@@ -27,7 +27,8 @@  discard block
 block discarded – undo
27 27
      */
28 28
     public function render(Compiler $compiler, Compiler\Result $result, NodeInterface $node): bool
29 29
     {
30
-        switch (true) {
30
+        switch (true)
31
+        {
31 32
             case $node instanceof Tag:
32 33
                 $this->tag($compiler, $result, $node);
33 34
                 return true;
@@ -51,8 +52,10 @@  discard block
 block discarded – undo
51 52
     {
52 53
         $result->push(sprintf('<%s', $node->name), $node->getContext());
53 54
 
54
-        foreach ($node->attrs as $attr) {
55
-            if (!$attr instanceof Attribute) {
55
+        foreach ($node->attrs as $attr)
56
+        {
57
+            if (!$attr instanceof Attribute)
58
+            {
56 59
                 $compiler->compile($attr, $result);
57 60
                 continue;
58 61
             }
@@ -62,11 +65,13 @@  discard block
 block discarded – undo
62 65
 
63 66
         $result->push(sprintf('%s>', $node->void ? '/' : ''), null);
64 67
 
65
-        foreach ($node->nodes as $child) {
68
+        foreach ($node->nodes as $child)
69
+        {
66 70
             $compiler->compile($child, $result);
67 71
         }
68 72
 
69
-        if (!$node->void) {
73
+        if (!$node->void)
74
+        {
70 75
             $result->push(sprintf('</%s>', $node->name), null);
71 76
         }
72 77
     }
@@ -78,19 +83,24 @@  discard block
 block discarded – undo
78 83
      */
79 84
     private function attribute(Compiler $compiler, Compiler\Result $result, Attr $node): void
80 85
     {
81
-        if ($node->name instanceof NodeInterface) {
86
+        if ($node->name instanceof NodeInterface)
87
+        {
82 88
             $result->push(' ', null);
83 89
             $compiler->compile($node->name, $result);
84
-        } else {
90
+        }
91
+        else
92
+        {
85 93
             $result->push(sprintf(' %s', $node->name), $node->getContext());
86 94
         }
87 95
 
88 96
         $value = $node->value;
89
-        if ($value instanceof Nil) {
97
+        if ($value instanceof Nil)
98
+        {
90 99
             return;
91 100
         }
92 101
 
93
-        if ($value instanceof NodeInterface) {
102
+        if ($value instanceof NodeInterface)
103
+        {
94 104
             $result->push('=', null);
95 105
             $compiler->compile($value, $result);
96 106
             return;
@@ -106,8 +116,10 @@  discard block
 block discarded – undo
106 116
      */
107 117
     private function verbatim(Compiler $compiler, Compiler\Result $result, Verbatim $node): void
108 118
     {
109
-        foreach ($node->nodes as $child) {
110
-            if (is_string($child)) {
119
+        foreach ($node->nodes as $child)
120
+        {
121
+            if (is_string($child))
122
+            {
111 123
                 $result->push($child, null);
112 124
                 continue;
113 125
             }
Please login to merge, or discard this patch.
src/Stempler/src/Compiler/Renderer/DynamicRenderer.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
     public function __construct(
37 37
         DirectiveRendererInterface $directiveRenderer = null,
38 38
         string $defaultFilter = self::DEFAULT_FILTER
39
-    ) {
39
+    ){
40 40
         $this->directiveRenderer = $directiveRenderer;
41 41
         $this->defaultFilter = $defaultFilter;
42 42
     }
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
      */
47 47
     public function render(Compiler $compiler, Compiler\Result $result, NodeInterface $node): bool
48 48
     {
49
-        switch (true) {
49
+        switch (true){
50 50
             case $node instanceof Output:
51 51
                 $this->output($result, $node);
52 52
                 return true;
@@ -66,9 +66,9 @@  discard block
 block discarded – undo
66 66
      */
67 67
     private function directive(Compiler\Result $source, Directive $directive): void
68 68
     {
69
-        if ($this->directiveRenderer !== null) {
69
+        if ($this->directiveRenderer !== null){
70 70
             $result = $this->directiveRenderer->render($directive);
71
-            if ($result !== null) {
71
+            if ($result !== null){
72 72
                 $source->push($result, $directive->getContext());
73 73
                 return;
74 74
             }
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
      */
87 87
     private function output(Compiler\Result $source, Output $output): void
88 88
     {
89
-        if ($output->rawOutput) {
89
+        if ($output->rawOutput){
90 90
             $source->push(sprintf('<?php echo %s; ?>', trim($output->body)), $output->getContext());
91 91
             return;
92 92
         }
Please login to merge, or discard this patch.
Braces   +8 added lines, -4 removed lines patch added patch discarded remove patch
@@ -46,7 +46,8 @@  discard block
 block discarded – undo
46 46
      */
47 47
     public function render(Compiler $compiler, Compiler\Result $result, NodeInterface $node): bool
48 48
     {
49
-        switch (true) {
49
+        switch (true)
50
+        {
50 51
             case $node instanceof Output:
51 52
                 $this->output($result, $node);
52 53
                 return true;
@@ -66,9 +67,11 @@  discard block
 block discarded – undo
66 67
      */
67 68
     private function directive(Compiler\Result $source, Directive $directive): void
68 69
     {
69
-        if ($this->directiveRenderer !== null) {
70
+        if ($this->directiveRenderer !== null)
71
+        {
70 72
             $result = $this->directiveRenderer->render($directive);
71
-            if ($result !== null) {
73
+            if ($result !== null)
74
+            {
72 75
                 $source->push($result, $directive->getContext());
73 76
                 return;
74 77
             }
@@ -86,7 +89,8 @@  discard block
 block discarded – undo
86 89
      */
87 90
     private function output(Compiler\Result $source, Output $output): void
88 91
     {
89
-        if ($output->rawOutput) {
92
+        if ($output->rawOutput)
93
+        {
90 94
             $source->push(sprintf('<?php echo %s; ?>', trim($output->body)), $output->getContext());
91 95
             return;
92 96
         }
Please login to merge, or discard this patch.
src/Stempler/src/Compiler/Renderer/CoreRenderer.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
         Compiler\Result $result,
32 32
         NodeInterface $node
33 33
     ): bool {
34
-        switch (true) {
34
+        switch (true){
35 35
             case $node instanceof Hidden:
36 36
                 return true;
37 37
 
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
                 $result->withinContext(
40 40
                     $node->getContext(),
41 41
                     function (Compiler\Result $source) use ($node, $compiler): void {
42
-                        foreach ($node->nodes as $child) {
42
+                        foreach ($node->nodes as $child){
43 43
                             $compiler->compile($child, $source);
44 44
                         }
45 45
                     }
@@ -51,8 +51,8 @@  discard block
 block discarded – undo
51 51
                 $result->withinContext(
52 52
                     $node->getContext(),
53 53
                     function (Compiler\Result $source) use ($node, $compiler): void {
54
-                        foreach ($node->nodes as $child) {
55
-                            if (is_string($child)) {
54
+                        foreach ($node->nodes as $child){
55
+                            if (is_string($child)){
56 56
                                 $source->push($child, null);
57 57
                                 continue;
58 58
                             }
Please login to merge, or discard this patch.
Braces   +8 added lines, -4 removed lines patch added patch discarded remove patch
@@ -31,7 +31,8 @@  discard block
 block discarded – undo
31 31
         Compiler\Result $result,
32 32
         NodeInterface $node
33 33
     ): bool {
34
-        switch (true) {
34
+        switch (true)
35
+        {
35 36
             case $node instanceof Hidden:
36 37
                 return true;
37 38
 
@@ -39,7 +40,8 @@  discard block
 block discarded – undo
39 40
                 $result->withinContext(
40 41
                     $node->getContext(),
41 42
                     function (Compiler\Result $source) use ($node, $compiler): void {
42
-                        foreach ($node->nodes as $child) {
43
+                        foreach ($node->nodes as $child)
44
+                        {
43 45
                             $compiler->compile($child, $source);
44 46
                         }
45 47
                     }
@@ -51,8 +53,10 @@  discard block
 block discarded – undo
51 53
                 $result->withinContext(
52 54
                     $node->getContext(),
53 55
                     function (Compiler\Result $source) use ($node, $compiler): void {
54
-                        foreach ($node->nodes as $child) {
55
-                            if (is_string($child)) {
56
+                        foreach ($node->nodes as $child)
57
+                        {
58
+                            if (is_string($child))
59
+                            {
56 60
                                 $source->push($child, null);
57 61
                                 continue;
58 62
                             }
Please login to merge, or discard this patch.
src/Stempler/src/Compiler/SourceMap.php 2 patches
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -40,8 +40,8 @@  discard block
 block discarded – undo
40 40
         // We can scan top level only
41 41
 
42 42
         /** @var Location $loc */
43
-        foreach ($this->lines as $line) {
44
-            if (!in_array($this->paths[$line[0]], $paths, true)) {
43
+        foreach ($this->lines as $line){
44
+            if (!in_array($this->paths[$line[0]], $paths, true)){
45 45
                 $paths[] = $this->paths[$line[0]];
46 46
             }
47 47
         }
@@ -59,13 +59,13 @@  discard block
 block discarded – undo
59 59
     public function getStack(int $line): array
60 60
     {
61 61
         $found = null;
62
-        foreach ($this->lines as $linen => $ctx) {
63
-            if ($linen <= $line) {
62
+        foreach ($this->lines as $linen => $ctx){
63
+            if ($linen <= $line){
64 64
                 $found = $ctx;
65 65
             }
66 66
         }
67 67
 
68
-        if ($found === null) {
68
+        if ($found === null){
69 69
             return [];
70 70
         }
71 71
 
@@ -109,9 +109,9 @@  discard block
 block discarded – undo
109 109
     {
110 110
         $map = new self();
111 111
 
112
-        foreach ($locations as $offset => $location) {
112
+        foreach ($locations as $offset => $location){
113 113
             $line = Source::resolveLine($content, $offset);
114
-            if (!isset($map->lines[$line])) {
114
+            if (!isset($map->lines[$line])){
115 115
                 $map->lines[$line] = $map->calculateLine($location, $loader);
116 116
             }
117 117
         }
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
             'line' => $line[1],
133 133
         ];
134 134
 
135
-        if ($line[2] !== null) {
135
+        if ($line[2] !== null){
136 136
             $this->unpack($result, $line[2]);
137 137
         }
138 138
     }
@@ -144,12 +144,12 @@  discard block
 block discarded – undo
144 144
      */
145 145
     private function calculateLine(Location $location, LoaderInterface $loader): array
146 146
     {
147
-        if (!isset($this->sourceCache[$location->path])) {
147
+        if (!isset($this->sourceCache[$location->path])){
148 148
             $this->sourceCache[$location->path] = $loader->load($location->path);
149 149
         }
150 150
         $path = $this->sourceCache[$location->path]->getFilename();
151 151
 
152
-        if (!in_array($path, $this->paths, true)) {
152
+        if (!in_array($path, $this->paths, true)){
153 153
             $this->paths[] = $path;
154 154
         }
155 155
 
Please login to merge, or discard this patch.
Braces   +20 added lines, -10 removed lines patch added patch discarded remove patch
@@ -40,8 +40,10 @@  discard block
 block discarded – undo
40 40
         // We can scan top level only
41 41
 
42 42
         /** @var Location $loc */
43
-        foreach ($this->lines as $line) {
44
-            if (!in_array($this->paths[$line[0]], $paths, true)) {
43
+        foreach ($this->lines as $line)
44
+        {
45
+            if (!in_array($this->paths[$line[0]], $paths, true))
46
+            {
45 47
                 $paths[] = $this->paths[$line[0]];
46 48
             }
47 49
         }
@@ -59,13 +61,16 @@  discard block
 block discarded – undo
59 61
     public function getStack(int $line): array
60 62
     {
61 63
         $found = null;
62
-        foreach ($this->lines as $linen => $ctx) {
63
-            if ($linen <= $line) {
64
+        foreach ($this->lines as $linen => $ctx)
65
+        {
66
+            if ($linen <= $line)
67
+            {
64 68
                 $found = $ctx;
65 69
             }
66 70
         }
67 71
 
68
-        if ($found === null) {
72
+        if ($found === null)
73
+        {
69 74
             return [];
70 75
         }
71 76
 
@@ -109,9 +114,11 @@  discard block
 block discarded – undo
109 114
     {
110 115
         $map = new self();
111 116
 
112
-        foreach ($locations as $offset => $location) {
117
+        foreach ($locations as $offset => $location)
118
+        {
113 119
             $line = Source::resolveLine($content, $offset);
114
-            if (!isset($map->lines[$line])) {
120
+            if (!isset($map->lines[$line]))
121
+            {
115 122
                 $map->lines[$line] = $map->calculateLine($location, $loader);
116 123
             }
117 124
         }
@@ -132,7 +139,8 @@  discard block
 block discarded – undo
132 139
             'line' => $line[1],
133 140
         ];
134 141
 
135
-        if ($line[2] !== null) {
142
+        if ($line[2] !== null)
143
+        {
136 144
             $this->unpack($result, $line[2]);
137 145
         }
138 146
     }
@@ -144,12 +152,14 @@  discard block
 block discarded – undo
144 152
      */
145 153
     private function calculateLine(Location $location, LoaderInterface $loader): array
146 154
     {
147
-        if (!isset($this->sourceCache[$location->path])) {
155
+        if (!isset($this->sourceCache[$location->path]))
156
+        {
148 157
             $this->sourceCache[$location->path] = $loader->load($location->path);
149 158
         }
150 159
         $path = $this->sourceCache[$location->path]->getFilename();
151 160
 
152
-        if (!in_array($path, $this->paths, true)) {
161
+        if (!in_array($path, $this->paths, true))
162
+        {
153 163
             $this->paths[] = $path;
154 164
         }
155 165
 
Please login to merge, or discard this patch.
src/Stempler/src/Node/Aggregate.php 2 patches
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -49,14 +49,14 @@  discard block
 block discarded – undo
49 49
      */
50 50
     public function accepts(string $name): ?string
51 51
     {
52
-        if ($this->pattern === '' || $this->pattern === '*') {
52
+        if ($this->pattern === '' || $this->pattern === '*'){
53 53
             // accept everything
54 54
             return $name;
55 55
         }
56 56
 
57 57
         $conditions = [];
58
-        foreach (explode(';', $this->pattern) as $condition) {
59
-            if (strpos($condition, ':') === false) {
58
+        foreach (explode(';', $this->pattern) as $condition){
59
+            if (strpos($condition, ':') === false){
60 60
                 //Invalid
61 61
                 continue;
62 62
             }
@@ -65,27 +65,27 @@  discard block
 block discarded – undo
65 65
             $conditions[$option] = $value;
66 66
         }
67 67
 
68
-        if (isset($conditions['include'])) {
68
+        if (isset($conditions['include'])){
69 69
             $include = explode(',', $conditions['include']);
70
-            if (in_array($name, $include)) {
70
+            if (in_array($name, $include)){
71 71
                 return $name;
72 72
             }
73 73
 
74 74
             return null;
75 75
         }
76 76
 
77
-        if (isset($conditions['exclude'])) {
77
+        if (isset($conditions['exclude'])){
78 78
             $exclude = explode(',', $conditions['exclude']);
79
-            if (in_array($name, $exclude)) {
79
+            if (in_array($name, $exclude)){
80 80
                 return null;
81 81
             }
82 82
 
83 83
             return $name;
84 84
         }
85 85
 
86
-        if (isset($conditions['prefix'])) {
86
+        if (isset($conditions['prefix'])){
87 87
             $conditions['prefix'] = rtrim($conditions['prefix'], ' *');
88
-            if (strpos($name, $conditions['prefix']) === 0) {
88
+            if (strpos($name, $conditions['prefix']) === 0){
89 89
                 return substr($name, strlen($conditions['prefix']));
90 90
             }
91 91
 
Please login to merge, or discard this patch.
Braces   +18 added lines, -9 removed lines patch added patch discarded remove patch
@@ -49,14 +49,17 @@  discard block
 block discarded – undo
49 49
      */
50 50
     public function accepts(string $name): ?string
51 51
     {
52
-        if ($this->pattern === '' || $this->pattern === '*') {
52
+        if ($this->pattern === '' || $this->pattern === '*')
53
+        {
53 54
             // accept everything
54 55
             return $name;
55 56
         }
56 57
 
57 58
         $conditions = [];
58
-        foreach (explode(';', $this->pattern) as $condition) {
59
-            if (strpos($condition, ':') === false) {
59
+        foreach (explode(';', $this->pattern) as $condition)
60
+        {
61
+            if (strpos($condition, ':') === false)
62
+            {
60 63
                 //Invalid
61 64
                 continue;
62 65
             }
@@ -65,27 +68,33 @@  discard block
 block discarded – undo
65 68
             $conditions[$option] = $value;
66 69
         }
67 70
 
68
-        if (isset($conditions['include'])) {
71
+        if (isset($conditions['include']))
72
+        {
69 73
             $include = explode(',', $conditions['include']);
70
-            if (in_array($name, $include)) {
74
+            if (in_array($name, $include))
75
+            {
71 76
                 return $name;
72 77
             }
73 78
 
74 79
             return null;
75 80
         }
76 81
 
77
-        if (isset($conditions['exclude'])) {
82
+        if (isset($conditions['exclude']))
83
+        {
78 84
             $exclude = explode(',', $conditions['exclude']);
79
-            if (in_array($name, $exclude)) {
85
+            if (in_array($name, $exclude))
86
+            {
80 87
                 return null;
81 88
             }
82 89
 
83 90
             return $name;
84 91
         }
85 92
 
86
-        if (isset($conditions['prefix'])) {
93
+        if (isset($conditions['prefix']))
94
+        {
87 95
             $conditions['prefix'] = rtrim($conditions['prefix'], ' *');
88
-            if (strpos($name, $conditions['prefix']) === 0) {
96
+            if (strpos($name, $conditions['prefix']) === 0)
97
+            {
89 98
                 return substr($name, strlen($conditions['prefix']));
90 99
             }
91 100
 
Please login to merge, or discard this patch.
src/Stempler/src/Lexer/Lexer.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -44,12 +44,12 @@  discard block
 block discarded – undo
44 44
     public function parse(StreamInterface $src): \Generator
45 45
     {
46 46
         $stream = new Buffer($this->generate($src));
47
-        foreach ($this->grammars as $grammar) {
47
+        foreach ($this->grammars as $grammar){
48 48
             $stream = new Buffer($this->wrap(clone $grammar, $stream));
49 49
         }
50 50
 
51 51
         // always group raw bytes into raw tokens
52
-        foreach ($this->wrap(new RawGrammar(), $stream) as $n) {
52
+        foreach ($this->wrap(new RawGrammar(), $stream) as $n){
53 53
             yield $n;
54 54
         }
55 55
     }
@@ -61,8 +61,8 @@  discard block
 block discarded – undo
61 61
      */
62 62
     private function wrap(GrammarInterface $grammar, Buffer $stream): \Generator
63 63
     {
64
-        foreach ($grammar->parse($stream) as $n) {
65
-            if ($n instanceof Token && $n->grammar === null) {
64
+        foreach ($grammar->parse($stream) as $n){
65
+            if ($n instanceof Token && $n->grammar === null){
66 66
                 $n->grammar = get_class($grammar);
67 67
             }
68 68
 
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
      */
79 79
     private function generate(StreamInterface $src)
80 80
     {
81
-        while (!$src->isEOI()) {
81
+        while (!$src->isEOI()){
82 82
             yield new Byte($src->getOffset(), $src->peak());
83 83
         }
84 84
     }
Please login to merge, or discard this patch.
Braces   +10 added lines, -5 removed lines patch added patch discarded remove patch
@@ -44,12 +44,14 @@  discard block
 block discarded – undo
44 44
     public function parse(StreamInterface $src): \Generator
45 45
     {
46 46
         $stream = new Buffer($this->generate($src));
47
-        foreach ($this->grammars as $grammar) {
47
+        foreach ($this->grammars as $grammar)
48
+        {
48 49
             $stream = new Buffer($this->wrap(clone $grammar, $stream));
49 50
         }
50 51
 
51 52
         // always group raw bytes into raw tokens
52
-        foreach ($this->wrap(new RawGrammar(), $stream) as $n) {
53
+        foreach ($this->wrap(new RawGrammar(), $stream) as $n)
54
+        {
53 55
             yield $n;
54 56
         }
55 57
     }
@@ -61,8 +63,10 @@  discard block
 block discarded – undo
61 63
      */
62 64
     private function wrap(GrammarInterface $grammar, Buffer $stream): \Generator
63 65
     {
64
-        foreach ($grammar->parse($stream) as $n) {
65
-            if ($n instanceof Token && $n->grammar === null) {
66
+        foreach ($grammar->parse($stream) as $n)
67
+        {
68
+            if ($n instanceof Token && $n->grammar === null)
69
+            {
66 70
                 $n->grammar = get_class($grammar);
67 71
             }
68 72
 
@@ -78,7 +82,8 @@  discard block
 block discarded – undo
78 82
      */
79 83
     private function generate(StreamInterface $src)
80 84
     {
81
-        while (!$src->isEOI()) {
85
+        while (!$src->isEOI())
86
+        {
82 87
             yield new Byte($src->getOffset(), $src->peak());
83 88
         }
84 89
     }
Please login to merge, or discard this patch.
src/Stempler/src/Lexer/StringStream.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@
 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
             return null;
58 58
         }
59 59
 
Please login to merge, or discard this patch.
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.