Passed
Push — master ( af3941...7aa8d1 )
by Nikita
04:06
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/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/Yacc/Parser.php 1 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/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.