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.
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
Enable PHP 8.4 comat #59
Enable PHP 8.4 comat #59
Changes from all commits
c0a8013
9405c99
fa5013a
aa0b53a
427290a
356983f
ad48c3a
4dab18d
1966caf
3695ce2
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codebase verification
Traits are not supported in the current implementation
The code inspection reveals that traits are not supported because:
extractClassName
method only checks forT_CLASS
andT_INTERFACE
tokenslist
method only usesclass_exists()
andinterface_exists()
T_TRAIT
token constant is not imported and trait detection is missingThis means traits like
CamelCaseTrait
in the codebase will be skipped by this implementation.🔗 Analysis chain
LGTM! Verify trait support
The implementation is correct and efficient. However, since we're scanning for PHP classes, we should verify if trait declarations are also supported as they are common in PHP projects.
Let me check the implementation of
getClassFromFile
method to verify trait support.Let me try a different approach to check the implementation.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
Length of output: 265
Script:
Length of output: 76
Script:
Length of output: 3723
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add error handling for token_get_all
The
token_get_all
function can fail and return false. This case should be handled explicitly.Apply this diff to fix:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add error handling for token_get_all
While the method handles file reading errors, it should also handle potential token_get_all failures.
Apply this diff to add error handling:
📝 Committable suggestion
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove @phpstan-ignore-line annotations
Instead of suppressing PHPStan warnings, we should fix the underlying type issues.
📝 Committable suggestion
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix type checking in extractClassName
Similar to the namespace extraction, the type checking should be improved here as well.
📝 Committable suggestion