test(phpstan): enable PHPStan level 3 for some of Pages/#1035
Draft
JohnVillalovos wants to merge 1 commit intodevelopfrom
Draft
test(phpstan): enable PHPStan level 3 for some of Pages/#1035JohnVillalovos wants to merge 1 commit intodevelopfrom
Pages/#1035JohnVillalovos wants to merge 1 commit intodevelopfrom
Conversation
Resolve PHPStan level 3 issues found when enabling checking of the `Pages/` directory, excluding 'Pages/Admin/` and `Pages/Ajax/`
Contributor
There was a problem hiding this comment.
Pull request overview
Enables stricter PHPStan (“next” config) checking for most of the Pages/ layer by narrowing the exclusion list, and resolves resulting level 3 type issues mainly by making page input getters return consistent scalar/array types.
Changes:
- Update
phpstan_next.neonto includePages/in level 3 analysis while excluding onlyPages/Admin/andPages/Ajax/. - Normalize several
Pages/*getters to returnint,float,string, orint[]consistently via explicit casting / array normalization. - Align a few interface/PHPDoc return types (and a related test fake) with the now-enforced types.
Reviewed changes
Copilot reviewed 20 out of 20 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tests/Presenters/UserCreditsPresenterTest.php | Updates fake page getters to match stricter int return types. |
| phpstan_next.neon | Adjusts exclusions so PHPStan level 3 runs on most of Pages/. |
| Pages/SearchAvailabilityPage.php | Normalizes resource-related form inputs to int / int[]. |
| Pages/Search/SearchReservationsPage.php | Normalizes form inputs (user/resources/schedules) to int / int[]. |
| Pages/SchedulePage.php | Casts schedule/resource/filter query params to int for consistent typing. |
| Pages/Reservation/ReservationPage.php | Corrects property PHPDoc to IPermissionServiceFactory. |
| Pages/Reservation/NewReservationPage.php | Updates PHPDoc return types to allow `Date |
| Pages/Reports/SavedReportsPage.php | Casts report id query param to int. |
| Pages/Reports/CommonReportsPage.php | Casts report id query param to int. |
| Pages/MonitorDisplayPage.php | Casts schedule/day/resource query params to int. |
| Pages/LoginPage.php | Ensures password getter returns a string. |
| Pages/Install/InstallPage.php | Ensures install password getter returns a string. |
| Pages/IPageable.php | Ensures paging getters return int consistently. |
| Pages/GuestParticipationPage.php | Fixes email getter signature/return to string. |
| Pages/Export/EmbeddedCalendarPage.php | Casts “days to show” query param to int. |
| Pages/Export/CalendarSubscriptionPage.php | Casts subscription day-range/accessory inputs to int. |
| Pages/Export/CalendarExportPage.php | Fixes accessory name getter signature/return to string; casts ids to int. |
| Pages/Export/AtomSubscriptionPage.php | Casts subscription day-range query params to int. |
| Pages/Credits/UserCreditsPage.php | Updates paging getters to int and normalizes numeric query params. |
| Pages/CalendarPage.php | Corrects URL factory PHPDoc return type to CalendarUrl. |
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.
Resolve PHPStan level 3 issues found when enabling checking of the
Pages/directory, excluding 'Pages/Admin/andPages/Ajax/`