Skip to content

feat!: replace dasprid/enum with native PHP enums#230

Open
DASPRiD wants to merge 1 commit intomainfrom
feat/native-enums
Open

feat!: replace dasprid/enum with native PHP enums#230
DASPRiD wants to merge 1 commit intomainfrom
feat/native-enums

Conversation

@DASPRiD
Copy link
Copy Markdown
Member

@DASPRiD DASPRiD commented Apr 5, 2026

BREAKING CHANGE: All enum classes (ErrorCorrectionLevel, Mode, CharacterSetEci, GradientType) are now native PHP enums. Static method access like ErrorCorrectionLevel::L() must be changed to ErrorCorrectionLevel::L (without parentheses).

Closes #198

BREAKING CHANGE: All enum classes (ErrorCorrectionLevel, Mode,
CharacterSetEci, GradientType) are now native PHP enums. Static
method access like ErrorCorrectionLevel::L() must be changed to
ErrorCorrectionLevel::L (without parentheses).

Closes #198

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 5, 2026

Codecov Report

❌ Patch coverage is 63.13364% with 80 lines in your changes missing coverage. Please review.
✅ Project coverage is 72.72%. Comparing base (bf7d67c) to head (c95e730).
⚠️ Report is 8 commits behind head on main.

Files with missing lines Patch % Lines
src/Renderer/Image/EpsImageBackEnd.php 0.00% 46 Missing ⚠️
src/Common/CharacterSetEci.php 85.00% 12 Missing ⚠️
src/Renderer/Image/SvgImageBackEnd.php 57.14% 12 Missing ⚠️
src/Renderer/Image/ImagickImageBackEnd.php 16.66% 5 Missing ⚠️
src/Common/ErrorCorrectionLevel.php 85.00% 3 Missing ⚠️
src/Common/Mode.php 95.00% 1 Missing ⚠️
src/Encoder/Encoder.php 92.85% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main     #230      +/-   ##
============================================
+ Coverage     71.81%   72.72%   +0.90%     
- Complexity      995     1075      +80     
============================================
  Files            49       49              
  Lines          3151     3226      +75     
============================================
+ Hits           2263     2346      +83     
+ Misses          888      880       -8     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@vlakoff
Copy link
Copy Markdown
Contributor

vlakoff commented Apr 6, 2026

You may also want to update in CLAUDE.md, changing:

   - `Version`, `ErrorCorrectionLevel`, `Mode`, `CharacterSetEci` - QR spec enums (using `dasprid/enum`)

to:

   - `Version`, `ErrorCorrectionLevel`, `Mode`, `CharacterSetEci` - QR spec enums

@DASPRiD
Copy link
Copy Markdown
Member Author

DASPRiD commented Apr 7, 2026

@vlakoff good point. the rest of the implementation looks fine to you?

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.

Native PHP enums for 3.0

2 participants