Repository navigation
chore(phpstan): enable level 4 for Domain/ and Presenters/ - #1885
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The review found no active issues, and the changes remove unused code while updating affected callers and PHPDoc to support the expanded PHPStan coverage.
No open issues 🎉
What changed in this PR
This pull request enables PHPStan level 4 analysis for Domain/ and Presenters/ by removing unused code and dependencies, simplifying affected callers, and correcting PHPDoc types.
Changes:
- Removes unused builders, properties, methods, dependencies, and unreachable code.
- Updates presenter factories, pages, and tests for simplified constructors.
- Removes the relevant PHPStan exclusions and corrects PHPDoc annotations.
| File | Description |
|---|---|
tests/Presenters/Reservation/ReservationSavePresenterTest.php |
Updates test setup after removing the persistence dependency. |
tests/Presenters/RegisterPresenterTest.php |
Removes obsolete authentication test setup and assertions. |
tests/Presenters/Admin/ManageResourcesPresenterTest.php |
Updates resource presenter construction. |
Presenters/Reservation/ReservationSavePresenter.php |
Removes the unused persistence service dependency. |
Presenters/Reservation/ReservationPresenterFactory.php |
Updates the reservation presenter factory call. |
Presenters/RegistrationPresenter.php |
Removes unused authentication handling. |
Presenters/GuestParticipationPresenter.php |
Removes unused invitation result state. |
Presenters/Dashboard/PastReservationsPresenter.php |
Removes a redundant date check. |
Presenters/Admin/ManageResourcesPresenter.php |
Removes the unused user preference repository. |
Presenters/Admin/ManageAnnouncementsPresenter.php |
Removes the unused permission service. |
Presenters/Admin/Import/ICalImportPresenter.php |
Removes the unused timezone helper. |
Presenters/ActionPresenter.php |
Removes unused validation storage and registration logic. |
phpstan_next.neon |
Removes Domain/ and Presenters/ from the PHPStan exclusions. |
Pages/Admin/ResourceAdminManageResourcesPage.php |
Updates resource-admin presenter construction. |
Pages/Admin/ManageResourcesPage.php |
Updates resource presenter construction. |
Pages/Admin/ManageAnnouncementsPage.php |
Updates announcement presenter construction. |
Domain/Values/SeriesUpdateScope.php |
Removes unreachable break statements. |
Domain/Values/ReservationReminder.php |
Removes unused interval state. |
Domain/User.php |
Removes the unused permissions dirty flag. |
Domain/ScheduleLayout.php |
Removes the unused cached flag. |
Domain/ReservationReminderView.php |
Corrects the interval property PHPDoc. |
Domain/ReservationItemView.php |
Corrects the buffer-seconds property PHPDoc. |
Domain/Group.php |
Removes unused permissions and roles dirty flags. |
Domain/ExistingReservationSeries.php |
Removes unused original repeat-option state. |
Domain/BookableResource.php |
Deletes the unused BookableResourceBuilder class. |
Review effort: Lite
Fix the level 4 findings in Domain/ and Presenters/ and remove both from the phpstan_next exclude list: - Delete BookableResourceBuilder, which nothing uses. - Drop properties that are written but never read: the permission and role dirty flags on User and Group (the repositories persist the added/removed lists), ExistingReservationSeries' _originalRepeatOptions, ScheduleLayout's cached flag, ReservationReminder's interval and InvitationResult's series/user. - Drop unused constructor dependencies: the permission service of ManageAnnouncementsPresenter, the user preference repository of ManageResourcesPresenter, the persistence service of ReservationSavePresenter and the authentication of RegistrationPresenter (post-registration login is handled by the PostRegistration plugin), and update their callers. - Remove ActionPresenter::AddValidation() and the unused private ICalImportPresenter::GetTimezone(). - Remove unreachable breaks after returns in SeriesUpdateScope and an always-true check in PastReservationsPresenter. - Correct the PHPDoc types of ReservationItemView::$bufferSeconds and ReservationReminderView::$interval. Assisted-by: Claude:claude-opus-5-5
JohnVillalovos
force-pushed
the
jlvillal/phpstan
branch
from
November 9, 2026 22:38
1630ca5 to
3e43e61
Compare
JohnVillalovos
enabled auto-merge (rebase)
November 9, 2026 22:38
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 level 4 findings in Domain/ and Presenters/ and remove both from the phpstan_next exclude list:
Assisted-by: Claude:claude-opus-5-5