-
Notifications
You must be signed in to change notification settings - Fork 86
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
Not able to match @null@||@array@
(again)
#471
Comments
@null@||@array@
(again)
Hey @Aerendir it looks like a bug. It seems that or condition is not handled properly and it's failing whenever the first check fails. |
I don't know... I tried to debug, but I'm not so used to the library, so I didn't had a good result... Anyway, the live sandbox is very useful! You should put it in a template for GitHub when opening a bug issue, asking to reproduce the problem... |
|
The issue comes from the "MatcherFactory", it builds an "ArrayMatcher" which uses an "OrMatcher" which don't use any "ArrayMatcher" in its chain and so this "OrMatcher" (which is different from the one used by the main matcher) is not able to match "@array@" (see https://github.com/coduo/php-matcher/blob/6.x/src/Factory/MatcherFactory.php#L52) |
There is already a closed issue that reports my same exact problem:
My array structure is almost this:
my_key
can also benull
:So, to validate this structure, I use this pattern:
This validation does not pass:
Am I doing it wrong or is it actually a bug?
The text was updated successfully, but these errors were encountered: