Skip to content

test(phpstan): enable PHPStan level 3 for some of Pages/#1035

Draft
JohnVillalovos wants to merge 1 commit intodevelopfrom
jlvillal/phpstan_3
Draft

test(phpstan): enable PHPStan level 3 for some of Pages/#1035
JohnVillalovos wants to merge 1 commit intodevelopfrom
jlvillal/phpstan_3

Conversation

@JohnVillalovos
Copy link
Collaborator

Resolve PHPStan level 3 issues found when enabling checking of the Pages/ directory, excluding 'Pages/Admin/andPages/Ajax/`

Resolve PHPStan level 3 issues found when enabling checking of the
`Pages/` directory, excluding 'Pages/Admin/` and `Pages/Ajax/`
Copilot AI review requested due to automatic review settings February 17, 2026 06:07
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.neon to include Pages/ in level 3 analysis while excluding only Pages/Admin/ and Pages/Ajax/.
  • Normalize several Pages/* getters to return int, float, string, or int[] 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.

@JohnVillalovos JohnVillalovos marked this pull request as draft February 17, 2026 06:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant