Skip to content

CONV-046: Fix OptionsSchemaField null default and tighten color regex#61

Merged
menvil merged 1 commit into
developfrom
chore/CONV-046-options-default-and-color-fixes
May 28, 2026
Merged

CONV-046: Fix OptionsSchemaField null default and tighten color regex#61
menvil merged 1 commit into
developfrom
chore/CONV-046-options-default-and-color-fixes

Conversation

@menvil

@menvil menvil commented May 28, 2026

Copy link
Copy Markdown
Owner

Summary

  • OptionsSchemaField::toArray() was always including 'default' => null, which made downstream array_key_exists('default', …) checks treat an implicit null as an explicit default. Now the key is omitted when no default is set.
  • OptionsValidator::ensureColor() regex {3,8} accepted invalid 5/7-char hex; restricted to lengths 3/4/6/8.
  • Regression test added for the toArray() omission.

Skipped CodeRabbit nitpick on contract reflection signature checks — low ROI.

Test plan

  • composer test — 114 passed
  • composer lint — passed

Summary by cubic

Fixes options schema serialization to omit the default key when no default is set, so null isn’t treated as an explicit default (addresses CONV-046). Also restricts color validation to 3/4/6/8-length hex values and adds a regression test.

Written for commit c521321. Summary will update on new commits.

Review in cubic

- OptionsSchemaField::toArray() now omits the "default" key when no default
  was provided, so OptionsValidator's array_key_exists("default", …) check
  no longer treats an implicit null as an explicit default.
- OptionsValidator::ensureColor() restricts hex lengths to 3, 4, 6, or 8;
  previously {3,8} let 5- and 7-character strings pass.
- Add regression test asserting toArray() omits "default" when not set.

Addresses CodeRabbit review on PR #59.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented May 28, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are limited based on label configuration.

🏷️ Required labels (at least one) (1)
  • release

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 6c665534-9b41-43a4-a782-76f0acf2639d

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/CONV-046-options-default-and-color-fixes

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@menvil menvil merged commit 74b180c into develop May 28, 2026
4 checks passed
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