Skip to content

Introduce RegexSyntaxValidator#42

Merged
lippserd merged 2 commits intomainfrom
RegexSyntaxValidator
Jan 15, 2026
Merged

Introduce RegexSyntaxValidator#42
lippserd merged 2 commits intomainfrom
RegexSyntaxValidator

Conversation

@Al2Klimov
Copy link
Member

@Al2Klimov Al2Klimov commented Jan 13, 2026

Introduce RegexSyntaxValidator to validate the syntax of regular expressions, e.g., /PATTERN/[MODIFIERS].
The implementation uses preg_last_error_msg(), which is only available in PHP 8.0 or later, so the minimum PHP version requirement has been raised.

@cla-bot cla-bot bot added the cla/signed label Jan 13, 2026
@Al2Klimov Al2Klimov force-pushed the RegexSyntaxValidator branch from ecb76c4 to 1c155e4 Compare January 13, 2026 16:44
@Al2Klimov Al2Klimov requested a review from lippserd January 13, 2026 16:48
@lippserd lippserd changed the title Introduce RegexSyntaxValidator Introduce RegexSyntaxValidator Jan 14, 2026
@sukhwinder33445
Copy link
Contributor

The Modernize code PR has moved the Translation trait to the BaseValidator class and may be merged before this PR, so please remove the trait usage.

Copy link
Member

@lippserd lippserd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please rephrase the first commit as follows:

Require PHP 8.0 for `preg_last_error_msg()` to be available

This message indicates the reason at first glance and it's perfectly fine to have a maximum of 72 characters instead of 50 in the commit message.

Please add backticks to RegexSyntaxValidator in the second commit message and always do this when referring to code in commit messages and descriptions. This significantly improves readability in GitHub and also a little in non-GitHub contexts (at least, it doesn't impair readability in my opinion).

And please adjust the PR description to include the purpose of the validator, e.g.:

Introduce RegexSyntaxValidator to validate the syntax of regular expressions, e.g., /PATTERN/[MODIFIERS].
The implementation uses preg_last_error_msg(), which is only available in PHP 8 or later, so the minimum PHP version requirement has been raised.

@Al2Klimov Al2Klimov force-pushed the RegexSyntaxValidator branch from 1c155e4 to f0af16b Compare January 15, 2026 14:05
@Al2Klimov Al2Klimov requested a review from lippserd January 15, 2026 14:08
@lippserd lippserd merged commit f1dcd1d into main Jan 15, 2026
13 checks passed
@lippserd lippserd deleted the RegexSyntaxValidator branch January 15, 2026 14:08
@lippserd lippserd added this to the v0.6.0 milestone Mar 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants