Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failing test: missing class method when trait aliases are used #1453

Open
wants to merge 1 commit into
base: 6.42.x
Choose a base branch
from

Conversation

janedbal
Copy link
Contributor

@janedbal janedbal commented Sep 6, 2024

See real reflection result: https://3v4l.org/TcNgp

@janedbal janedbal changed the title Failing test: missing class method with trait aliases are used Failing test: missing class method when trait aliases are used Sep 6, 2024
@janedbal
Copy link
Contributor Author

janedbal commented Sep 6, 2024

For a reference, it is causing false-positives in our PHPStan-based dead-code-detector: https://github.com/shipmonk-rnd/dead-code-detector/pull/70/files#diff-16ea0828915ea4592d186f3dfab87f40606c659da6d84ed4204d69a8d34cf058R6

@Ocramius
Copy link
Member

Ocramius commented Sep 6, 2024

I'm really really really convinced that traits should never have existed in PHP :D

@janedbal
Copy link
Contributor Author

janedbal commented Sep 7, 2024

I'm really really really convinced that traits should never have existed in PHP :D

Totally agree! The dead-code-detector would have been 3 times less complex without them :)

Comment on lines +150 to +152
use Trait1FixtureG, Trait2FixtureG {
method1 as alias1;
method3 as alias3;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BTW, didn't even know this multi-trait-import-with-alias syntax was legal 😱

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants