Passed
Push — master ( d788ce...af3941 )
by Nikita
04:55
created
src/CodeGen/Template.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -73,7 +73,7 @@
 block discarded – undo
73 73
 
74 74
     /**
75 75
      * @param CompressResult $result
76
-     * @param $resultFile
76
+     * @param resource $resultFile
77 77
      * @param null $headerFile
78 78
      *
79 79
      * @throws LogicException
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@  discard block
 block discarded – undo
5 5
  * For the full copyright and license information, please view the LICENSE
6 6
  * file that was distributed with this source code.
7 7
  */
8
-declare(strict_types=1);
8
+declare(strict_types = 1);
9 9
 
10 10
 namespace PhpYacc\CodeGen;
11 11
 
@@ -280,7 +280,7 @@  discard block
 block discarded – undo
280 280
      */
281 281
     protected function skipif(string $spec): bool
282 282
     {
283
-        [ $dump, $test ] = \explode(' ', $spec, 2);
283
+        [$dump, $test] = \explode(' ', $spec, 2);
284 284
         $test = \trim($test);
285 285
         switch ($test) {
286 286
             case '-a':
Please login to merge, or discard this patch.
src/Grammar/Context.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -219,7 +219,7 @@
 block discarded – undo
219 219
      * Context constructor.
220 220
      *
221 221
      * @param string        $filename
222
-     * @param resource|null $debugFile
222
+     * @param null|resource $debugFile
223 223
      */
224 224
     public function __construct(string $filename = 'YY', resource $debugFile = null)
225 225
     {
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@  discard block
 block discarded – undo
5 5
  * For the full copyright and license information, please view the LICENSE
6 6
  * file that was distributed with this source code.
7 7
  */
8
-declare(strict_types=1);
8
+declare(strict_types = 1);
9 9
 
10 10
 namespace PhpYacc\Grammar;
11 11
 
@@ -286,7 +286,7 @@  discard block
 block discarded – undo
286 286
             $nil->code = $code++;
287 287
         }
288 288
 
289
-        \usort($this->_symbols, function ($a, $b) {
289
+        \usort($this->_symbols, function($a, $b) {
290 290
             return $a->code <=> $b->code;
291 291
         });
292 292
     }
Please login to merge, or discard this patch.
src/Grammar/Symbol.php 2 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
      * @param int         $terminal
80 80
      * @param int         $precedence
81 81
      * @param int         $associativity
82
-     * @param Symbol|null $type
82
+     * @param null|\self $type
83 83
      *
84 84
      * @throws LogicException
85 85
      */
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
     }
175 175
 
176 176
     /**
177
-     * @param Symbol|null $type
177
+     * @param null|\self $type
178 178
      */
179 179
     public function setType(self $type = null)
180 180
     {
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@
 block discarded – undo
5 5
  * For the full copyright and license information, please view the LICENSE
6 6
  * file that was distributed with this source code.
7 7
  */
8
-declare(strict_types=1);
8
+declare(strict_types = 1);
9 9
 
10 10
 namespace PhpYacc\Grammar;
11 11
 
Please login to merge, or discard this patch.
src/Lalr/Conflict.php 2 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
      * Conflict constructor.
31 31
      *
32 32
      * @param Symbol        $symbol
33
-     * @param Conflict|null $next
33
+     * @param null|\self $next
34 34
      */
35 35
     protected function __construct(Symbol $symbol, self $next = null)
36 36
     {
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
     }
72 72
 
73 73
     /**
74
-     * @param Conflict|null $next
74
+     * @param null|\self $next
75 75
      */
76 76
     public function setNext(self $next = null)
77 77
     {
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@
 block discarded – undo
5 5
  * For the full copyright and license information, please view the LICENSE
6 6
  * file that was distributed with this source code.
7 7
  */
8
-declare(strict_types=1);
8
+declare(strict_types = 1);
9 9
 
10 10
 namespace PhpYacc\Lalr;
11 11
 
Please login to merge, or discard this patch.
src/Yacc/Parser.php 3 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -96,7 +96,7 @@
 block discarded – undo
96 96
     /**
97 97
      * @param array $symbols
98 98
      * @param int   $n
99
-     * @param $delm
99
+     * @param string $delm
100 100
      * @param array $attribute
101 101
      *
102 102
      * @throws ParseException
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@  discard block
 block discarded – undo
5 5
  * For the full copyright and license information, please view the LICENSE
6 6
  * file that was distributed with this source code.
7 7
  */
8
-declare(strict_types=1);
8
+declare(strict_types = 1);
9 9
 
10 10
 namespace PhpYacc\Yacc;
11 11
 
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
 
126 126
         $expanded = $this->macros->apply($this->context, $symbols, $tokens, $n, $attribute);
127 127
 
128
-        $action = \implode('', \array_map(function (Token $token) {
128
+        $action = \implode('', \array_map(function(Token $token) {
129 129
             return $token->getValue();
130 130
         }, $expanded));
131 131
 
Please login to merge, or discard this patch.
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -272,7 +272,7 @@
 block discarded – undo
272 272
                 continue;
273 273
             }
274 274
             if (($j = $symbol->value) === null) {
275
-                throw new ParseException("Nonterminal {$symbol->name} used but not defined");
275
+                throw new ParseException("nonterminal {$symbol->name} used but not defined");
276 276
             }
277 277
             $k = null;
278 278
             while ($j) {
Please login to merge, or discard this patch.
src/Macro.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@
 block discarded – undo
5 5
  * For the full copyright and license information, please view the LICENSE
6 6
  * file that was distributed with this source code.
7 7
  */
8
-declare(strict_types=1);
8
+declare(strict_types = 1);
9 9
 
10 10
 namespace PhpYacc;
11 11
 
Please login to merge, or discard this patch.
src/Support/Utils.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@  discard block
 block discarded – undo
5 5
  * For the full copyright and license information, please view the LICENSE
6 6
  * file that was distributed with this source code.
7 7
  */
8
-declare(strict_types=1);
8
+declare(strict_types = 1);
9 9
 
10 10
 namespace PhpYacc\Support;
11 11
 
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
             $indexedArray[] = [$item, $i++];
109 109
         }
110 110
 
111
-        \usort($indexedArray, function (array $a, array $b) use ($cmp) {
111
+        \usort($indexedArray, function(array $a, array $b) use ($cmp) {
112 112
             $result = $cmp($a[0], $b[0]);
113 113
             if ($result !== 0) {
114 114
                 return $result;
Please login to merge, or discard this patch.
src/Exception/LexingException.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@
 block discarded – undo
5 5
  * For the full copyright and license information, please view the LICENSE
6 6
  * file that was distributed with this source code.
7 7
  */
8
-declare(strict_types=1);
8
+declare(strict_types = 1);
9 9
 
10 10
 namespace PhpYacc\Exception;
11 11
 
Please login to merge, or discard this patch.
src/Lalr/Generator.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
                 }
145 145
             }
146 146
 
147
-            $tmpList = $this->sortList($tmpList, function (Lr1 $x, Lr1 $y) {
147
+            $tmpList = $this->sortList($tmpList, function(Lr1 $x, Lr1 $y) {
148 148
                 $gx = $x->item[-1]->code;
149 149
                 $gy = $y->item[-1]->code;
150 150
                 if ($gx !== $gy) {
@@ -320,7 +320,7 @@  discard block
 block discarded – undo
320 320
             if (!$tdefact) {
321 321
                 $tdefact = -1;
322 322
 
323
-                Utils::stableSort($tmpr, function (Reduce $x, Reduce $y) {
323
+                Utils::stableSort($tmpr, function(Reduce $x, Reduce $y) {
324 324
                     if ($x->number != $y->number) {
325 325
                         return $y->number - $x->number;
326 326
                     }
@@ -344,11 +344,11 @@  discard block
 block discarded – undo
344 344
             }
345 345
 
346 346
             // Squeeze tmpr
347
-            $tmpr = array_filter($tmpr, function (Reduce $reduce) use ($tdefact) {
347
+            $tmpr = array_filter($tmpr, function(Reduce $reduce) use ($tdefact) {
348 348
                 return $reduce->number !== $tdefact;
349 349
             });
350 350
 
351
-            Utils::stableSort($tmpr, function (Reduce $x, Reduce $y) {
351
+            Utils::stableSort($tmpr, function(Reduce $x, Reduce $y) {
352 352
                 if ($x->symbol !== $y->symbol) {
353 353
                     return $x->symbol->code - $y->symbol->code;
354 354
                 }
@@ -386,7 +386,7 @@  discard block
 block discarded – undo
386 386
         // Sort states in decreasing order of entries
387 387
         // do not move initial state
388 388
         $initState = array_shift($this->states);
389
-        Utils::stableSort($this->states, function (State $p, State $q) {
389
+        Utils::stableSort($this->states, function(State $p, State $q) {
390 390
             $numReduces = count($p->reduce) - 1; // -1 for default action
391 391
             $pt = $numReduces;
392 392
             $pn = count($p->shifts) + $numReduces;
Please login to merge, or discard this patch.
Upper-Lower-Casing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -564,8 +564,8 @@  discard block
 block discarded – undo
564 564
                 /** @var Symbol $left */
565 565
                 $left = $gram->body[0];
566 566
                 $right = $gram->body[1] ?? null;
567
-                if (($right === null || ($right->associativity & Production::EMPTY)) && !($left->associativity & Production::EMPTY)) {
568
-                    $left->setAssociativityFlag(Production::EMPTY);
567
+                if (($right === null || ($right->associativity & Production::empty)) && !($left->associativity & Production::empty)) {
568
+                    $left->setAssociativityFlag(Production::empty);
569 569
                     $changed = true;
570 570
                 }
571 571
             }
@@ -574,7 +574,7 @@  discard block
 block discarded – undo
574 574
         if ($this->context->debug) {
575 575
             $this->context->debug('EMPTY nonterminals: ');
576 576
             foreach ($this->context->nonterminals as $symbol) {
577
-                if ($symbol->associativity & Production::EMPTY) {
577
+                if ($symbol->associativity & Production::empty) {
578 578
                     $this->context->debug(' '.$symbol->name);
579 579
                 }
580 580
             }
@@ -681,7 +681,7 @@  discard block
 block discarded – undo
681 681
      */
682 682
     protected function findEmpty(Lr1 $tail, Symbol $x): Lr1
683 683
     {
684
-        if (!$this->visited[$x->code] && ($x->associativity & Production::EMPTY)) {
684
+        if (!$this->visited[$x->code] && ($x->associativity & Production::empty)) {
685 685
             $this->visited[$x->code] = true;
686 686
 
687 687
             /** @var Production $gram */
Please login to merge, or discard this patch.