Skip to content

Fix enum case casing#348

Merged
freost merged 15 commits intomasterfrom
fix-enum-case-casing
Mar 3, 2026
Merged

Fix enum case casing#348
freost merged 15 commits intomasterfrom
fix-enum-case-casing

Conversation

@freost
Copy link
Member

@freost freost commented Mar 3, 2026

Type


Yes/No
Bugfix? No
New feature? No
Other? Yes

Additional information

Yes/No
Has backwards compatibility breaks? No
Has unit and/or integration tests? Yes

Description


This PR updates all enum cases to use PascalCase instead of "UPPER_SNAKE_CASE". It also provides backwards compatibility by offering the old cases as public constants. All the constants are marked as deprecated and will be removed in Mako 13.

// Old
LoginStatus::INVALID_CREDENTIALS;

// New
LoginStatus::InvalidCredentials;

@freost freost force-pushed the fix-enum-case-casing branch from 94d214b to dcd3b93 Compare March 3, 2026 19:07
@freost freost changed the title Fix LoginStatus enum Fix enum case casing Mar 3, 2026
@freost freost requested a review from Copilot March 3, 2026 21:37
@freost freost marked this pull request as ready for review March 3, 2026 21:39
Copy link

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 PR standardizes enum case naming across the framework from UPPER_SNAKE_CASE to PascalCase, and introduces backwards compatibility by exposing the previous names as deprecated public constants until Mako 13.

Changes:

  • Convert enum cases (and call sites/tests) to PascalCase.
  • Add deprecated public constants on enums to preserve legacy UPPER_SNAKE_CASE access.
  • Update changelog with the deprecation note.

Reviewed changes

Copilot reviewed 65 out of 66 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tests/unit/http/routing/RouterTest.php Update status enum usage to PascalCase.
tests/unit/http/response/senders/stream/event/FieldTest.php Update event stream Type enum usage to PascalCase.
tests/unit/http/response/senders/stream/event/EventTest.php Update event stream Type enum usage to PascalCase.
tests/unit/http/response/senders/RedirectTest.php Update Status enum usage to PascalCase.
tests/unit/http/response/senders/EventStreamTest.php Update event stream Type enum usage to PascalCase.
tests/unit/http/response/builders/JSONTest.php Update Status enum usage to PascalCase.
tests/unit/http/response/StatusTest.php Update Status enum usage to PascalCase.
tests/unit/http/ResponseTest.php Update Status enum usage to PascalCase.
tests/unit/gatekeeper/adapters/SessionTest.php Update LoginStatus and Status enum usage to PascalCase.
tests/unit/gatekeeper/LoginStatusTest.php Update LoginStatus enum usage to PascalCase.
tests/unit/file/PermissionsTest.php Update Permission enum usage to PascalCase.
tests/unit/file/PermissionTest.php Update Permission enum usage to PascalCase.
tests/unit/error/handlers/web/ProductionHandlerTest.php Update Status enum usage to PascalCase.
tests/unit/database/query/compilers/PostgresCompilerTest.php Update VectorDistance enum usage to PascalCase.
tests/unit/database/query/compilers/MySQLCompilerTest.php Update VectorDistance enum usage to PascalCase.
tests/unit/database/query/compilers/MariaDBCompilerTest.php Update VectorDistance enum usage to PascalCase.
tests/unit/cli/input/components/SelectTest.php Update Key enum usage to PascalCase.
tests/unit/cli/input/components/ConfirmationTest.php Update Key enum usage to PascalCase.
tests/unit/FunctionsTest.php Update env Type enum usage to PascalCase.
src/mako/pixel/metadata/xmp/properties/Type.php Add deprecated legacy constants + PascalCase enum cases.
src/mako/pixel/metadata/xmp/XmpReader.php Update enum case references for XMP property typing.
src/mako/pixel/image/operations/traits/CalculateNewDimensionsTrait.php Update AspectRatio enum case references to PascalCase.
src/mako/pixel/image/operations/imagemagick/Watermark.php Update WatermarkPosition enum case references to PascalCase.
src/mako/pixel/image/operations/imagemagick/Resize.php Update AspectRatio enum default to PascalCase.
src/mako/pixel/image/operations/imagemagick/Flip.php Update flip direction enum usage to PascalCase.
src/mako/pixel/image/operations/gd/Watermark.php Update WatermarkPosition enum case references to PascalCase.
src/mako/pixel/image/operations/gd/Resize.php Update AspectRatio enum default to PascalCase.
src/mako/pixel/image/operations/gd/Flip.php Update flip direction enum usage to PascalCase.
src/mako/pixel/image/operations/WatermarkPosition.php Add deprecated legacy constants + PascalCase enum cases (and fix doc text).
src/mako/pixel/image/operations/Flip.php Add deprecated legacy constants + PascalCase enum cases.
src/mako/pixel/image/operations/AspectRatio.php Add deprecated legacy constants + PascalCase enum cases.
src/mako/http/response/senders/stream/event/Type.php Add deprecated legacy constants + PascalCase enum cases.
src/mako/http/response/senders/Redirect.php Update Status enum usage to PascalCase.
src/mako/http/response/senders/File.php Update Status enum usage to PascalCase.
src/mako/http/response/Status.php Add deprecated legacy constants + PascalCase enum cases; update message mapping.
src/mako/http/exceptions/UnsupportedMediaTypeException.php Update Status enum usage to PascalCase.
src/mako/http/exceptions/UnauthorizedException.php Update Status enum usage to PascalCase.
src/mako/http/exceptions/TooManyRequestsException.php Update Status enum usage to PascalCase.
src/mako/http/exceptions/ServiceUnavailableException.php Update Status enum usage to PascalCase.
src/mako/http/exceptions/RangeNotSatisfiableException.php Update Status enum usage to PascalCase.
src/mako/http/exceptions/NotFoundException.php Update Status enum usage to PascalCase.
src/mako/http/exceptions/MethodNotAllowedException.php Update Status enum usage to PascalCase.
src/mako/http/exceptions/InvalidTokenException.php Update Status enum usage to PascalCase.
src/mako/http/exceptions/GoneException.php Update Status enum usage to PascalCase.
src/mako/http/exceptions/ForbiddenException.php Update Status enum usage to PascalCase.
src/mako/http/exceptions/BadRequestException.php Update Status enum usage to PascalCase.
src/mako/http/Response.php Update Status enum usage to PascalCase.
src/mako/gatekeeper/adapters/Session.php Update LoginStatus/Status enum usage to PascalCase.
src/mako/gatekeeper/LoginStatus.php Add deprecated legacy constants + PascalCase enum cases; update boolean helper.
src/mako/functions.php Update env Type enum match arms to PascalCase.
src/mako/file/Permissions.php Update Permission enum usage to PascalCase.
src/mako/file/Permission.php Add deprecated legacy constants + PascalCase enum cases.
src/mako/file/FileSystem.php Update permission mask enum usage to PascalCase.
src/mako/file/FileInfo.php Update permission mask enum usage to PascalCase.
src/mako/error/handlers/web/Handler.php Update Status enum usage to PascalCase.
src/mako/env/Type.php Add deprecated legacy constants + PascalCase enum cases.
src/mako/database/query/values/out/VectorDistance.php Update vector distance enum usage to PascalCase.
src/mako/database/query/compilers/Postgres.php Update vector distance enum usage to PascalCase.
src/mako/database/query/compilers/MySQL.php Update vector distance enum usage to PascalCase.
src/mako/database/query/compilers/MariaDB.php Update vector distance enum usage to PascalCase.
src/mako/database/query/VectorDistance.php Add deprecated legacy constants + PascalCase enum cases.
src/mako/database/query/Query.php Update default enum parameters to PascalCase.
src/mako/cli/input/components/Select.php Update Key enum comparisons to PascalCase.
src/mako/cli/input/components/Confirmation.php Update Key enum comparisons to PascalCase.
src/mako/cli/input/Key.php Add deprecated legacy constants + PascalCase enum cases.
CHANGELOG.md Document enum-case deprecations for 12.2.0.

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

Copy link

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 65 out of 66 changed files in this pull request and generated 1 comment.


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

@freost freost merged commit 6f29eac into master Mar 3, 2026
4 checks passed
@freost freost deleted the fix-enum-case-casing branch March 3, 2026 21:58
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