Passed
Pull Request — master (#4)
by Nikita
05:38 queued 01:22
created
src/Lalr/Generator.php 1 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.
src/Yacc/Production.php 1 patch
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@
 block discarded – undo
16 16
  */
17 17
 class Production
18 18
 {
19
-    const EMPTY = 0x10;
19
+    const empty = 0x10;
20 20
 
21 21
     /**
22 22
      * @var Production|null
Please login to merge, or discard this patch.
src/Lalr/Item.php 1 patch
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -78,7 +78,7 @@
 block discarded – undo
78 78
     public function offsetGet($index)
79 79
     {
80 80
         if (!$this->offsetExists($index)) {
81
-            throw new LogicException("Offset $index does not exist");
81
+            throw new LogicException("offset $index does not exist");
82 82
         }
83 83
 
84 84
         return $this->production->body[$index + $this->pos];
Please login to merge, or discard this patch.
src/Compress/Compress.php 1 patch
Upper-Lower-Casing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
 class Compress
20 20
 {
21 21
     const UNEXPECTED = 32767;
22
-    const DEFAULT = -32766;
22
+    const default = -32766;
23 23
     const VACANT = -32768;
24 24
 
25 25
     /**
@@ -480,7 +480,7 @@  discard block
 block discarded – undo
480 480
                         if ($cTermAction[$i][$j] === $table[$this->context->oTermIndex[$j]]) {
481 481
                             $cTermAction[$i][$j] = self::VACANT;
482 482
                         } elseif ($cTermAction[$i][$j] === self::VACANT) {
483
-                            $cTermAction[$i][$j] = self::DEFAULT;
483
+                            $cTermAction[$i][$j] = self::default;
484 484
                         }
485 485
                     }
486 486
                 }
Please login to merge, or discard this patch.
src/CodeGen/Template.php 1 patch
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -431,7 +431,7 @@
 block discarded – undo
431 431
             case 'YYUNEXPECTED':
432 432
                 return \sprintf('%d', Compress::UNEXPECTED);
433 433
             case 'YYDEFAULT':
434
-                return \sprintf('%d', Compress::DEFAULT);
434
+                return \sprintf('%d', Compress::default);
435 435
             case 'YYMAXLEX':
436 436
                 return \sprintf('%d', \count($this->compress->yytranslate));
437 437
             case 'YYLAST':
Please login to merge, or discard this patch.