phpfmt_stable icon indicating copy to clipboard operation
phpfmt_stable copied to clipboard

method-modifiers get stripped if class has constant-values containing the class-keyword (name resolution)

Open droptable opened this issue 9 years ago • 1 comments

If a class has constant-values containing the class-keyword (used for name resolution) all method-modifiers get stripped from all methods except the first method.

Example:

class Foo
{
  const BAR_CLASS = Bar::class;
  
  public function method1()
  {
    // ...
  }

  public function method2()
  {
    // ...
  }

  protected function method3()
  {
    // ...
  }
}

Result:

class Foo
{
  const BAR_CLASS = Bar::class;

  public function method1()
  {
    // ...
  }


  function method2()
  {
    // ...
  }

  function method3()
  {
    // ...
  }
}

droptable avatar Dec 05 '16 12:12 droptable

I solved this issue there : https://github.com/MKCG/phpfmt_7-1

MKCG avatar Dec 06 '17 16:12 MKCG