Skip to content

Allow final modifier when using a method from a trait #11394

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

Merged
merged 1 commit into from
Jun 7, 2023

Conversation

nielsdos
Copy link
Member

@nielsdos nielsdos commented Jun 7, 2023

Fixes GH-11388.

Following https://wiki.php.net/rfc/horizontalreuse which introduced traits, this should be allowed.
The implementation was refactored in 3f8c729. That commit is the first time the "final" check appears AFAICT, but no reason was given for why. That commit seems to have landed in 5.4.11 and the NEWS for that version doesn't seem to mention something relevant to the behaviour change. This patch removes the restriction of the final modifier.

Copy link
Member

@iluuu1994 iluuu1994 left a comment

Choose a reason for hiding this comment

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

Makes sense to me 👍 A positive test might be nice, i.e. one that doesn't error.

Fixes phpGH-11388.

Following https://wiki.php.net/rfc/horizontalreuse which introduced traits,
this should be allowed.
The implementation was refactored in 3f8c729. That commit is the first time
the "final" check appears AFAICT, but no reason was given for why. That
commit seems to have landed in 5.4.11 and the NEWS for that version doesn't
seem to mention something relevant to the behaviour change.
This patch removes the restriction of the final modifier.

Closes phpGH-11394.
@nielsdos nielsdos merged commit 79d024a into php:master Jun 7, 2023
@nielsdos
Copy link
Member Author

nielsdos commented Jun 7, 2023

Merged with positive test, thx for reviewing.

@armandRobled
Copy link

Php-master

Copy link

@armandRobled armandRobled left a comment

Choose a reason for hiding this comment

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

  • [ ]

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

Successfully merging this pull request may close these issues.

Allow "final" modifier when importing a method from a trait
3 participants