test(phpstan): fix level 3 typing issues in tests/fakes/#1014
test(phpstan): fix level 3 typing issues in tests/fakes/#1014JohnVillalovos merged 1 commit intodevelopfrom
tests/fakes/#1014Conversation
There was a problem hiding this comment.
Pull request overview
Enables PHPStan level 3 analysis for tests/fakes/ by adjusting fake implementations and annotations so their return types and properties are more strictly typed and consistent with the interfaces they implement.
Changes:
- Remove
tests/fakes/from PHPStan excludes to include it in level 3 checks. - Replace
null/unimplemented stub returns in fakes with concrete typed defaults ([],false,0,1,'') or explicitLogicExceptions where appropriate. - Tighten typing via return type hints and updated PHPDoc across multiple fake classes.
Reviewed changes
Copilot reviewed 32 out of 32 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/fakes/TestReservationItemView.php | Cast reservation id to an int default to satisfy stricter typing. |
| tests/fakes/FakeWebAuthentication.php | Make prompt/action option methods return booleans instead of null. |
| tests/fakes/FakeUserRepository.php | Return typed defaults for repository methods (ids/arrays/count). |
| tests/fakes/FakeTermsOfServiceRepository.php | Return an int id from Add() instead of null. |
| tests/fakes/FakeServer.php | Update cookie return PHPDoc to allow null. |
| tests/fakes/FakeSchedules.php | Return typed defaults for unimplemented schedule repository methods. |
| tests/fakes/FakeScheduleLayout.php | Ensure GetLayout() always returns an array; return typed booleans. |
| tests/fakes/FakeRestServer.php | Ensure URL getters always return strings; implement GetFullServiceUrl() via GetServiceUrl(). |
| tests/fakes/FakeResourceService.php | Align fake service return types with IResourceService (arrays) and throw for unsupported calls. |
| tests/fakes/FakeResourceRepository.php | Return typed defaults and implement minimal Add() behavior; throw for unsupported calls. |
| tests/fakes/FakeReservationWaitlistRepository.php | Throw explicitly for unimplemented LoadById() instead of returning null. |
| tests/fakes/FakeReservationViewRepository.php | Return arrays for query methods; make iteration always yield arrays. |
| tests/fakes/FakeReservationService.php | Fix PHPDoc for reservations list property to be an array. |
| tests/fakes/FakeReservationRepository.php | Return typed defaults for attachment/color rule methods (ids/arrays) and throw for unsupported loads. |
| tests/fakes/FakeReservationConflictIdentifier.php | Fix PHPDoc to indicate _IndexedConflicts is an array. |
| tests/fakes/FakeReservationCheckinPage.php | Implement retry-parameter storage/retrieval in the fake. |
| tests/fakes/FakeReport.php | Add return type hint and align PHPDoc for custom attributes. |
| tests/fakes/FakeRegistrationPage.php | Add array return type + update PHPDoc for attributes getter. |
| tests/fakes/FakePermissionService.php | Update PHPDoc to use IPermissibleResource[]. |
| tests/fakes/FakePaymentRepository.php | Update PHPDoc and ensure GetList() always returns a PageableData. |
| tests/fakes/FakeGroupRepository.php | Return typed empty arrays instead of null for list methods. |
| tests/fakes/FakeExistingReservationPage.php | Implement unavailable state flags and return a boolean. |
| tests/fakes/FakeDailyLayout.php | Return typed defaults (true/[]) and throw for unsupported summary generation. |
| tests/fakes/FakeConfig.php | Avoid direct File() usage in SetKey(); remove redundant override for typing. |
| tests/fakes/FakeBlackoutRepository.php | Return an int id from Add() instead of null. |
| tests/fakes/FakeAttributeService.php | Return an empty array for missing categories; throw for unimplemented GetById(). |
| tests/fakes/FakeAttributeList.php | Add return types and adjust PHPDoc to LBAttribute[] where appropriate. |
| tests/fakes/FakeAnnouncements.php | Return typed defaults and throw for unsupported LoadById(). |
| tests/fakes/FakeAccessoryRepository.php | Throw for unimplemented load; implement minimal Add() behavior returning an id. |
| tests/fakes/DBRows.php | Add parameter/return type hints for row helpers; correct some return annotations. |
| tests/fakes/DBFakes.php | Return arrays from fake readers/queries to satisfy stricter typing. |
| phpstan_next.neon | Include tests/fakes/ in the PHPStan analysis scope. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
2527777 to
fa515b9
Compare
Enable PHPStan level 3 checking of the `tests/fakes` directory.
fa515b9 to
74982b6
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 32 out of 32 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.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 32 out of 32 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.
Enable PHPStan level 3 checking of the
tests/fakesdirectory.