Skip to content

Feat(Syntax): Implement ArrayType constraint, validator, and related schema improvements#42

Merged
edevsh merged 9 commits intocorebranch:1.xfrom
edevsh:syntax/array
Oct 10, 2025
Merged

Feat(Syntax): Implement ArrayType constraint, validator, and related schema improvements#42
edevsh merged 9 commits intocorebranch:1.xfrom
edevsh:syntax/array

Conversation

@edevsh
Copy link
Member

@edevsh edevsh commented Oct 10, 2025

Summary

This pull request introduces the ArrayType constraint and validator within the Syntax module, extending the schema system to handle array-based type validation. It also includes supporting factory registrations, unit tests, and a refactor to improve schema consistency.

Changes

  • Added ArrayType constraint class for array schema validation.
  • Added ArrayTypeValidator with support for item type checks and length boundaries.
  • Added unit tests for ArrayType, ConstraintFactory, and SchemaFactory.
  • Registered new schema and constraint factories in the container.
  • Refactored BaseConstraint to remove the default value of the schema parameter and mark it as required.
  • Updated ArraySchema::items() to return an array instead of a string, exposing the full item definition.

🚨 Breaking Change

  • ArraySchema::items() now returns an array instead of a string.

@edevsh edevsh self-assigned this Oct 10, 2025
@edevsh edevsh added enhancement New feature or request breaking change Indicates a change that breaks backward compatibility and requires updates in dependent code labels Oct 10, 2025
@codecov
Copy link

codecov bot commented Oct 10, 2025

Codecov Report

❌ Patch coverage is 94.80519% with 4 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...mponentGenerator/Field/ArrayComponentGenerator.php 0.00% 3 Missing ⚠️
src/Service/Syntax/Factory/SchemaFactory.php 94.11% 1 Missing ⚠️

❌ Your project status has failed because the head coverage (42.02%) is below the target coverage (80.00%). You can increase the head coverage or adjust the target coverage.

Files with missing lines Coverage Δ Complexity Δ
...exicon/V1/TypeSpecificSchema/Field/ArraySchema.php 85.71% <100.00%> (+85.71%) 7.00 <1.00> (ø)
...yntax/Constraints/ArrayType/ArrayTypeValidator.php 100.00% <100.00%> (ø) 14.00 <14.00> (?)
src/Service/Syntax/Constraints/Constraint.php 100.00% <100.00%> (ø) 3.00 <1.00> (ø)
src/Service/Syntax/Factory/ConstraintFactory.php 100.00% <100.00%> (ø) 1.00 <1.00> (?)
src/Service/Syntax/Factory/SchemaFactory.php 94.11% <94.11%> (ø) 1.00 <1.00> (?)
...mponentGenerator/Field/ArrayComponentGenerator.php 0.00% <0.00%> (ø) 19.00 <0.00> (ø)

... and 9 files with indirect coverage changes

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

@edevsh edevsh merged commit 9f857dc into corebranch:1.x Oct 10, 2025
6 of 7 checks passed
@edevsh edevsh deleted the syntax/array branch October 10, 2025 10:30
@edevsh
Copy link
Member Author

edevsh commented Oct 10, 2025

@codex review

@chatgpt-codex-connector
Copy link

Codex Review: Didn't find any major issues. Swish!

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking change Indicates a change that breaks backward compatibility and requires updates in dependent code enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant