Completed
Push — master ( 920773...91194f )
by Kirill
15:14 queued 12:57
created
src/Grammar/Analyzer.php 2 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
     /**
75 75
      * Build the analyzer of the rules (does not analyze the rules).
76 76
      *
77
-     * @return Rule[]|\Traversable
77
+     * @return \Generator
78 78
      * @throws GrammarException
79 79
      */
80 80
     public function analyze(): iterable
@@ -309,7 +309,7 @@  discard block
 block discarded – undo
309 309
      * Implementation of “simple”.
310 310
      *
311 311
      * @param LookaheadIterator $tokens
312
-     * @param int|string|null $pNodeId
312
+     * @param string|null $pNodeId
313 313
      * @return string|int|null
314 314
      * @throws GrammarException
315 315
      */
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -244,23 +244,23 @@  discard block
 block discarded – undo
244 244
                 break;
245 245
 
246 246
             case Parser::T_REPEAT_N_TO_M:
247
-                $min = (int)$tokens->current()->getValue(1);
248
-                $max = (int)$tokens->current()->getValue(2);
247
+                $min = (int) $tokens->current()->getValue(1);
248
+                $max = (int) $tokens->current()->getValue(2);
249 249
                 $tokens->next();
250 250
                 break;
251 251
 
252 252
             case Parser::T_REPEAT_ZERO_TO_M:
253
-                [$min, $max] = [0, (int)$tokens->current()->getValue(1)];
253
+                [$min, $max] = [0, (int) $tokens->current()->getValue(1)];
254 254
                 $tokens->next();
255 255
                 break;
256 256
 
257 257
             case Parser::T_REPEAT_N_OR_MORE:
258
-                [$min, $max] = [(int)$tokens->current()->getValue(1), -1];
258
+                [$min, $max] = [(int) $tokens->current()->getValue(1), -1];
259 259
                 $tokens->next();
260 260
                 break;
261 261
 
262 262
             case Parser::T_REPEAT_EXACTLY_N:
263
-                $min = $max = (int)$tokens->current()->getValue(1);
263
+                $min = $max = (int) $tokens->current()->getValue(1);
264 264
                 $tokens->next();
265 265
                 break;
266 266
         }
@@ -367,7 +367,7 @@  discard block
 block discarded – undo
367 367
     {
368 368
         $tokenName = $tokens->current()->getValue(1);
369 369
 
370
-        if (! \array_key_exists($tokenName, $this->rules)) {
370
+        if (!\array_key_exists($tokenName, $this->rules)) {
371 371
             $error = \vsprintf('Cannot call rule %s() in rule %s because it does not exist.', [
372 372
                 $tokenName,
373 373
                 $this->ruleName,
Please login to merge, or discard this patch.
src/Grammar/Delegate/RuleDelegate.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@
 block discarded – undo
39 39
     }
40 40
 
41 41
     /**
42
-     * @param RuleInterface|NodeInterface $rule
42
+     * @param null|NodeInterface $rule
43 43
      * @return \Traversable
44 44
      */
45 45
     private function getTokens(RuleInterface $rule): \Traversable
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
      */
29 29
     public function getInnerTokens(): iterable
30 30
     {
31
-        return new LookaheadIterator((function () {
31
+        return new LookaheadIterator((function() {
32 32
             yield from $this->getTokens($this->first('RuleProduction'));
33 33
             yield new Eoi(0);
34 34
         })->call($this));
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
      */
67 67
     public function isKept(): bool
68 68
     {
69
-        return (bool)$this->first('ShouldKeep');
69
+        return (bool) $this->first('ShouldKeep');
70 70
     }
71 71
 
72 72
     /**
Please login to merge, or discard this patch.
src/Console/GrammarCompileCommand.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -23,12 +23,12 @@
 block discarded – undo
23 23
     /**
24 24
      * @var string Default parser output path
25 25
      */
26
-    private const PARSER_GRAMMAR = __DIR__ . '/../../resources/grammar.pp2';
26
+    private const PARSER_GRAMMAR = __DIR__.'/../../resources/grammar.pp2';
27 27
 
28 28
     /**
29 29
      * @var string Default parser output path
30 30
      */
31
-    private const OUT_PATH = __DIR__ . '/../Grammar';
31
+    private const OUT_PATH = __DIR__.'/../Grammar';
32 32
 
33 33
     /**
34 34
      * @var string Default generated parser class name
Please login to merge, or discard this patch.
src/Console/CompileCommand.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@
 block discarded – undo
41 41
             $compiler->setClassName($in->getOption('class'));
42 42
         }
43 43
 
44
-        $cwd = \getcwd() ?: __DIR__ . '/..';
44
+        $cwd = \getcwd() ?: __DIR__.'/..';
45 45
 
46 46
         $compiler->saveTo($in->getOption('dir') ?: $cwd);
47 47
     }
Please login to merge, or discard this patch.
src/Console/AnalyzeCommand.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@
 block discarded – undo
37 37
 
38 38
         $ast = $in->getOption('root') ? $ast->first($in->getOption('root')) : $ast;
39 39
 
40
-        $out->write((string)$ast);
40
+        $out->write((string) $ast);
41 41
     }
42 42
 
43 43
     /**
Please login to merge, or discard this patch.
src/Grammar/Reader.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -111,7 +111,7 @@
 block discarded – undo
111 111
 
112 112
                 case $child instanceof TokenDelegate:
113 113
                     $this->lexer->add($child->getTokenName(), $child->getTokenPattern());
114
-                    if (! $child->isKept()) {
114
+                    if (!$child->isKept()) {
115 115
                         $this->lexer->skip($child->getTokenName());
116 116
                     }
117 117
                     break;
Please login to merge, or discard this patch.
src/Compiler.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
      */
81 81
     public function saveTo(string $path): void
82 82
     {
83
-        $pathName = $path . '/' . $this->class . '.php';
83
+        $pathName = $path.'/'.$this->class.'.php';
84 84
 
85 85
         if (\is_file($pathName)) {
86 86
             \unlink($pathName);
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
         \ob_start();
99 99
 
100 100
         try {
101
-            require __DIR__ . '/../resources/templates/parser.tpl.php';
101
+            require __DIR__.'/../resources/templates/parser.tpl.php';
102 102
             return \ob_get_contents();
103 103
         } catch (\Throwable $e) {
104 104
             throw $e;
Please login to merge, or discard this patch.
src/Grammar/Delegate/IncludeDelegate.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@
 block discarded – undo
30 30
         $file = $this->getValue(1);
31 31
 
32 32
         foreach (['', '.pp', '.pp2'] as $ext) {
33
-            $path = \dirname($from->getPathname()) . '/' . $file . $ext;
33
+            $path = \dirname($from->getPathname()).'/'.$file.$ext;
34 34
 
35 35
             if (\is_file($path)) {
36 36
                 return File::fromPathname($path);
Please login to merge, or discard this patch.