Skip to content

chore(phpstan): enable level 4 for WebServices/ - #1887

Merged
JohnVillalovos merged 1 commit into
developfrom
jlvillal/phpstan
Nov 9, 2026
Merged

JohnVillalovos merged 1 commit into
developfrom
jlvillal/phpstan

Conversation

@JohnVillalovos

Copy link
Copy Markdown
Collaborator

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

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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 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

@JohnVillalovos
JohnVillalovos merged commit 7631eeb into develop Nov 9, 2026
19 checks passed
@JohnVillalovos
JohnVillalovos deleted the jlvillal/phpstan branch November 9, 2026 23:02
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.

2 participants