test(phpstan): fix remaining level 3 typing issues in tests/#1015
Merged
JohnVillalovos merged 1 commit intodevelopfrom Feb 15, 2026
Merged
test(phpstan): fix remaining level 3 typing issues in tests/#1015JohnVillalovos merged 1 commit intodevelopfrom
tests/#1015JohnVillalovos merged 1 commit intodevelopfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Enables PHPStan level 3 analysis across the entire tests/ tree by tightening test double typings and adjusting fake-page return values to match declared contracts.
Changes:
- Updates phpDoc types in multiple test fakes to satisfy PHPStan’s array/union expectations.
- Adjusts various fake page getters to return non-null defaults aligned with interface phpDocs (e.g.,
'',0,false,[]). - Updates
phpstan_next.neonto stop excludingtests/Presenters/from analysis.
Reviewed changes
Copilot reviewed 23 out of 23 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/fakes/FakeResourceService.php | Broadens $_AllResources phpDoc to include an additional fake resource type. |
| tests/fakes/FakeReservationViewRepository.php | Refines iteration storage typing for reservation lists. |
| tests/fakes/FakePaymentRepository.php | Adjusts phpDocs for credit cost and gateway fields to satisfy PHPStan. |
| tests/fakes/FakeAttributeService.php | Refines $_ByCategory phpDoc to represent category-to-attributes structure. |
| tests/Presenters/SearchAvailabilityPresenterTest.php | Casts repeat interval getter to `string |
| tests/Presenters/Search/SearchReservationsPresenterTest.php | Returns empty strings instead of null for requested date getters. |
| tests/Presenters/SchedulePresenterTest.php | Updates fake page getters to return typed defaults instead of null. |
| tests/Presenters/ResourceDisplayPresenterTest.php | Updates fake getters to typed defaults ('', false). |
| tests/Presenters/Reservation/ReservationWaitlistPresenterTest.php | Updates fake getters to typed defaults ([], ''). |
| tests/Presenters/Reservation/ReservationMovePresenterTest.php | Updates retry-parameter getter to []. |
| tests/Presenters/Reservation/ReservationInitializationTest.php | Narrows initializer property phpDoc to concrete type. |
| tests/Presenters/Reservation/ReservationAttributesPresenterTest.php | Updates fake page phpDocs and return values for PHPStan. |
| tests/Presenters/Reservation/GuestReservationPresenterTest.php | Replaces null date returns with Date::Now() and boolean default. |
| tests/Presenters/Reports/SavedReportsPresenterTest.php | Aligns bound definition phpDoc to interface type. |
| tests/Presenters/Reports/GenerateReportPresenterTest.php | Normalizes several “IDs” getters to always return arrays; widens usage type. |
| tests/Presenters/RegisterPresenterTest.php | Removes teardown nulling of properties. |
| tests/Presenters/LoginPresenterTest.php | Introduces local variable for page arg; updates captcha getter default. |
| tests/Presenters/EmbeddedCalendarPresenterTest.php | Updates title format getter to return ''. |
| tests/Presenters/CalendarSubscriptionPresenterTest.php | Updates accessory IDs getter to return 0. |
| tests/Presenters/Admin/ManageUsersPresenterTest.php | Implements GetImportFile() to return an UploadedFile test instance; typed defaults elsewhere. |
| tests/Presenters/Admin/ManagePaymentsPresenterTest.php | Adds explicit phpDoc cast for PayPal fake gateway variable. |
| tests/Presenters/Admin/ManageConfigurationPresenterTest.php | Updates getters to typed defaults ('', 0). |
| phpstan_next.neon | Removes tests/Presenters/ from excludePaths to include it in analysis. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
tests/Presenters/Reservation/ReservationAttributesPresenterTest.php
Outdated
Show resolved
Hide resolved
Enable PHPStan level 3 checking of all of the `tests/` directory.
4016d63 to
b1f9252
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 24 out of 24 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Enable PHPStan level 3 checking of all of the
tests/directory.