Skip to content

test(phpstan): fix level 3 typing issues in tests/fakes/#1014

Merged
JohnVillalovos merged 1 commit intodevelopfrom
jlvillal/phpstan_3
Feb 15, 2026
Merged

test(phpstan): fix level 3 typing issues in tests/fakes/#1014
JohnVillalovos merged 1 commit intodevelopfrom
jlvillal/phpstan_3

Conversation

@JohnVillalovos
Copy link
Collaborator

Enable PHPStan level 3 checking of the tests/fakes directory.

Copilot AI review requested due to automatic review settings February 15, 2026 04:25
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 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 explicit LogicExceptions 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.

Enable PHPStan level 3 checking of the `tests/fakes` directory.
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

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.

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

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.

@JohnVillalovos JohnVillalovos merged commit 2c15873 into develop Feb 15, 2026
17 checks passed
@JohnVillalovos JohnVillalovos deleted the jlvillal/phpstan_3 branch February 15, 2026 04:47
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