phpfmt_stable icon indicating copy to clipboard operation
phpfmt_stable copied to clipboard

Method visibility removed when using 'insteadof'

Open alvinmok opened this issue 9 years ago • 1 comments

all method keywords (abstract, public, static, etc) are removed using psr-2 formatting whenever a trait declaration block exists.

eg

class A
{
    use TraitA, TraitB {
        TraitB::get insteadof TraitA;
    }

    final public static function test()
    {
        return 'class A';
    }
}

after formatting, it becomes

class A
{
    use TraitA, TraitB {
        TraitB::get insteadof TraitA;
    }

    function test()
    {
        return 'hello from class A';
    }
}

alvinmok avatar Sep 06 '16 08:09 alvinmok

This also happens with aliases (TraitA::method as methodA).

droptable avatar Oct 24 '16 12:10 droptable