Skip to content

wip: testing#1020

Closed
JohnVillalovos wants to merge 1 commit intodevelopfrom
jlvillal/test_ci
Closed

wip: testing#1020
JohnVillalovos wants to merge 1 commit intodevelopfrom
jlvillal/test_ci

Conversation

@JohnVillalovos
Copy link
Collaborator

This is done so that it will work better with types in the future. Previously it would have to be typed as an int. Now we can type as ScheduleStyle in many places. Not all as sometimes do need to pass the int value.

Copilot AI review requested due to automatic review settings February 15, 2026 20:11
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

This pull request converts the ScheduleStyle class from using public constants to a backed PHP enum (enum ScheduleStyle: int), improving type safety throughout the codebase. The change allows schedule style to be typed as ScheduleStyle in many places instead of ambiguous int/string types, while maintaining backward compatibility with integer storage in the database and cookies.

Changes:

  • Converted ScheduleStyle from a class with public constants to a backed enum with integer values
  • Updated method signatures to use proper ScheduleStyle types with nullable return types where appropriate
  • Modified array keys in style mappings to use ->value for integer keys
  • Updated template expressions to access enum values using ->value syntax

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated no comments.

Show a summary per file
File Description
Domain/Schedule.php Converted ScheduleStyle to backed enum, updated property type to ScheduleStyle, modified getter to return int and setter to accept int|ScheduleStyle
Pages/SchedulePage.php Updated interface and implementation method signatures to use ScheduleStyle types, modified cookie handling to convert between int and enum
Pages/ViewSchedulePage.php Updated style mapping array keys to use enum->value
Pages/ScheduleViewerViewSchedulesPage.php Updated style names array keys to use enum->value
Pages/Admin/ManageSchedulesPage.php Updated style names array keys to use enum->value
Presenters/Schedule/SchedulePageBuilder.php Added enum conversion logic using tryFrom() with fallback to Standard
WebServices/SchedulesWebService.php Updated method signatures to use ScheduleStyle types
tests/Presenters/SchedulePresenterTest.php Updated test mock to return enum and accept enum parameter
tests/Domain/Schedule/ScheduleRepositoryTest.php Updated test to use enum->value for int storage
tests/fakes/FakeSchedules.php Updated fake data to use enum->value
tpl/Schedule/schedule.tpl Updated template expressions to access enum values using ->value

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

This is done so that it will work better with types in the future.
Previously it would have to be typed as an int. Now we can type as
ScheduleStyle in many places. Not all as sometimes do need to pass the
int value.
@JohnVillalovos JohnVillalovos deleted the jlvillal/test_ci branch February 15, 2026 20:45
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