PHP 8.3 Support: Marking overridden methods (#[\Override]) #6701#6873
Merged
junichi11 merged 4 commits intoapache:masterfrom Dec 23, 2023
Merged
PHP 8.3 Support: Marking overridden methods (#[\Override]) #6701#6873junichi11 merged 4 commits intoapache:masterfrom
junichi11 merged 4 commits intoapache:masterfrom
Conversation
- Don't handle private methods as overridden/overriding methods - Handle also methods of Enum - Improve results of unit tests - Add/Fix unit tests
junichi11
commented
Dec 22, 2023
junichi11
commented
Dec 22, 2023
Member
Author
|
@tmysik I may have missed something, but I've added as many unit tests as possible. |
Member
Author
|
Will fix failed tests later. |
- apache#6701 - https://wiki.php.net/rfc/marking_overriden_methods - Add the `hasOverrideAttribute()` method to the `PhpVersion` - Add the `AddOverrideAttributeHint` - Add unit tests - Increment spec versions Note: If some trait methods have `#[\Override]`, we should also check wheter the parent class has them. However, attributes are not indexed at the moment. So, we should improve the indexer. (Currently, the following case is not supported.) e.g. ```php trait T { #[\Override] public function traitMethod(): void {} } class C { // Fatal error: C::traitMethod() has #[\Override] attribute, but no matching parent method exists use T; } ```
- apache#6701 - https://wiki.php.net/rfc/marking_overriden_methods - Fix the code generator, code completion, and `ImplementAbstractMethodsHintError` - Add/Fix unit tests
9a45ad2 to
fd64377
Compare
tmysik
reviewed
Dec 22, 2023
tmysik
reviewed
Dec 22, 2023
tmysik
approved these changes
Dec 22, 2023
Member
tmysik
left a comment
There was a problem hiding this comment.
The number of tests is amazing, we should be safe here 🙂
@junichi11 Thanks for your perfect work!
Member
Author
|
@tmysik Thank you for your review and your time :) |
…the `getInterfaes()`
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix the Overriding Methods feature
PHP 8.3 Support: Marking overridden methods (#[\Override]) (Part 1)
hasOverrideAttribute()method to thePhpVersionAddOverrideAttributeHintNote:
If some trait methods have
#[\Override], we should also check wheter the parent class has them.However, attributes are not indexed at the moment. So, we should improve the indexer.
(Currently, the following case is not supported.)
e.g.
PHP 8.3 Support: Marking overridden methods (#[\Override]) (Part 2)
ImplementAbstractMethodsHintErrorCode Generator:
Code Completion:
Hint: