Repository navigation
chore(phpstan): enable level 4 for WebServices/ - #1887
Merged
Merged
Conversation
Fix the level 4 findings in WebServices/ and remove it from the phpstan_next exclude list: - Mark ReservationRequest's recurrenceRule, startReminder, endReminder and retryParameters, and ResourceRequest's statusId, as nullable. They come from client JSON and may be omitted, so the existing empty()/isset() guards are correct. - Mark ScheduleWebServiceView::$startDate as nullable; the slots endpoint now passes null when startDateTime is omitted. - Drop write-only properties from ReservationRequestResponseFacade (retry and waitlist state) and ScheduleWebServiceView (availability and concurrency flags). Their setters remain because the page interfaces require them; the API does not report these values. - Remove the unused ReservationsWebService::FilterProvided(). Assisted-by: Claude:claude-opus-5-5
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain, and the changes align nullable inputs and remove unused code to support the intended PHPStan level 4 coverage.
No open issues 🎉
What changed in this PR
This pull request enables PHPStan level 4 analysis for WebServices/ by aligning nullable types with client input, removing unused state and helpers, and updating the exclusion list.
Changes:
- Mark optional request and schedule fields as nullable.
- Remove unused retry, waitlist, availability, and concurrency properties while preserving required interface setters.
- Remove the unused
FilterProvided()helper. - Remove
WebServices/from the PHPStan level 4 exclusion list.
| File | Description |
|---|---|
WebServices/SchedulesWebService.php |
Makes the schedule start date nullable and removes unused availability/concurrency state. |
WebServices/ReservationsWebService.php |
Removes the unused FilterProvided() helper. |
WebServices/Requests/Resource/ResourceRequest.php |
Marks optional statusId input as nullable. |
WebServices/Requests/ReservationRequest.php |
Marks optional recurrence, reminder, and retry fields as nullable. |
WebServices/Controllers/ReservationSaveController.php |
Removes unused retry and waitlist response properties while preserving required interface setters. |
phpstan_next.neon |
Removes WebServices/ from the PHPStan level 4 exclusion list. |
Review effort: Lite
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.
Fix the level 4 findings in WebServices/ and remove it from the phpstan_next exclude list:
Assisted-by: Claude:claude-opus-5-5