Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(parser): Remove PHP warnings on unknown modifier '\' #7

Merged

Conversation

iksaku
Copy link
Contributor

@iksaku iksaku commented May 4, 2021

They say that A picture is worth a thousand words...

image

This WARNING is thrown while parsing Price objects from strings. This is due to the regex pattern generator not knowing that the forward slash (/) character should be escaped.

More specifically, this warning is raised when the following currency symbols are being tested in the regex:

Currency Code Symbol Generated Pattern (Error Highlighted)
PAB B/. image
PEN S/. image

In order to fix this, we only need to flag the forward character (/) as part of the escaped regex characters, which is what this little PR does.

Copy link
Member

@toonvandenbos toonvandenbos left a comment

Choose a reason for hiding this comment

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

Thanks! Sorry for the delay, kinda lost this out of sight.

@toonvandenbos toonvandenbos merged commit c3d25ca into whitecube:2.x Aug 11, 2021
@iksaku iksaku deleted the fix/preg_unsupported_modifier_warning branch August 11, 2021 19:50
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