Просмотр исходного кода

bug #4127 LowercaseConstantsFixer - Fix case with properties using constants as their name (srathbone)

This PR was merged into the 2.12 branch.

Discussion
----------

LowercaseConstantsFixer - Fix case with properties using constants as their name

Commits
-------

6bdc98a LowercaseConstantsFixer - Fix case where fixer would incorrectly change class properties after the object operator.
SpacePossum 6 лет назад
Родитель
Сommit
bfd2e87936

+ 1 - 0
src/Fixer/Casing/LowercaseConstantsFixer.php

@@ -83,6 +83,7 @@ final class LowercaseConstantsFixer extends AbstractFixer
             T_INTERFACE,
             T_NEW,
             T_NS_SEPARATOR,
+            T_OBJECT_OPERATOR,
             T_PAAMAYIM_NEKUDOTAYIM,
             T_TRAIT,
             T_USE,

+ 1 - 0
tests/Fixer/Casing/LowercaseConstantsFixerTest.php

@@ -139,6 +139,7 @@ final class LowercaseConstantsFixerTest extends AbstractFixerTestCase
         }
     }',
             ],
+            ['<?php class Foo { public function Bar() { $this->False = 1; $this->True = 2; $this->Null = 3; } }'],
         ];
     }
 }