[Refactor:Developer] PHPStan typing on magic methods#11726
Merged
Conversation
Member
Author
|
Please do not push on my branch without asking me first |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #11726 +/- ##
============================================
+ Coverage 19.99% 21.04% +1.04%
Complexity 9077 9077
============================================
Files 249 258 +9
Lines 34335 34866 +531
Branches 461 461
============================================
+ Hits 6865 7337 +472
- Misses 27013 27072 +59
Partials 457 457
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
williamjallen
left a comment
Member
There was a problem hiding this comment.
Looks pretty good overall. I'd be fine merging it as-is, but I'd like to get some answers to the inline questions I left first.
williamjallen
approved these changes
Jun 13, 2025
bmcutler
pushed a commit
that referenced
this pull request
Aug 1, 2025
### Why is this Change Important & Necessary? <!-- Include any GitHub issue that is fixed/closed using "Fixes #<number>" or "Closes #<number>" syntax. Alternately write "Partially addresses #<number>" or "Related to #<number>" as appropriate. --> Gradeable.php previously relied on magic methods. This caused challenges for upgrading PHPUnit and and continuing to support PHPStan for static type analysis. PR #11726 mostly addressed these concerns. However magic methods have caused confusion for junior Submitty developers. AND the code still contained typos/errors in the types of these methods. ### What is the New Behavior? <!-- Include before & after screenshots/videos if the user interface has changed. --> This PR removes the magic methods usage in one file. The getters and setters are manually created. ### What steps should a reviewer take to reproduce or test the bug or new feature? ### Automated Testing & Documentation <!-- Is this feature sufficiently tested by unit tests and end-to-end tests? If this PR does not add/update the necessary automated tests, write a new GitHub issue and link it below. Is this feature sufficiently documented on submitty.org? Link related PRs or new GitHub issue to update documentation. --> ### Other information <!-- Is this a breaking change? Does this PR include migrations to update existing installations? Are there security concerns with this PR? -->
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.
Please check if the PR fulfills these requirements:
What is the current behavior?
PHPStan collects no typing information off of magic methods. Due to our high usage of magic methods, this significantly hurts the type static analysis.
What is the new behavior?
PHPStan now collects typing information from magic methods.
Other information?
I ignored some of the newer more complex phpstan errors. Some of them are a bit concerning and should be addressed ASAP but don't belong in this PR. The ones that were simple I did fix.