djoos / Symfony-coding-standard

Development repository for the Symfony coding standard
MIT License
401 stars 102 forks source link

Symfony.ControlStructure.UnaryOperators.Invalid fails on ++self::$x #179

Closed SimonHeimberg closed 4 years ago

SimonHeimberg commented 4 years ago

In case of class constants, postfix is forced (self::$x++ is valid, ++self::$x is invalid). Is this expected?

Missing test cases in Symfony/Tests/ControlStructure/UnaryOperatorsUnitTest.inc:

++Class::$v; // should be valid, but fails currently
Class::$v++; // valid
++$obj->v; // valid
$obj->v++;  // valid

version: 3.10.0 (of escapestudios/symfony2-coding-standard)

mmoll commented 4 years ago

@SimonHeimberg Could you check GH-181?