Skip to content

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

Merged
ndossche merged 1 commit into
php:masterfrom
ndossche:trait-1
Jun 7, 2023
Merged

ndossche merged 1 commit into
php:masterfrom
ndossche:trait-1

Conversation

@ndossche

@ndossche ndossche commented Jun 7, 2023

Copy link
Copy Markdown
Member

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.

@iluuu1994 iluuu1994 left a comment

Copy link
Copy Markdown
Member

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.
@ndossche
ndossche merged commit 79d024a into php:master Jun 7, 2023
@ndossche

ndossche commented Jun 7, 2023

Copy link
Copy Markdown
Member Author

Merged with positive test, thx for reviewing.

@armandRobled

Copy link
Copy Markdown

Php-master

@armandRobled armandRobled left a comment

Copy link
Copy Markdown

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