Skip to content

Support complex trait usage scenarios #36

Open
@aik099

Description

@aik099

PHP Docs: https://www.php.net/manual/en/language.oop5.traits.php

  1. if there is a class member (property/member), then its declaration wins over the declaration from the trait (important for the bc command)
  2. multi-trait conflict resolution via insteadof keyword (an edge case, but good to have; not sure how ReflectionClass would get me that):
use A, B {
    B::smallTalk insteadof A;
}
  1. trait method/property/constant renames on the fly using as keyword (can retrieve via ReflectionClass::getTraitAliases):
use A, B {
    B::bigTalk as talk;
}
  1. trait method/property/constant visibility change on the fly using as keyword (not sure how ReflectionClass would get me that):
use HelloWorld { sayHello as private myPrivateHello; }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions