Skip to content
This repository has been archived by the owner on Sep 20, 2021. It is now read-only.

"in" operator fails when array contains a single item #17

Closed
jaimz22 opened this issue Aug 7, 2014 · 1 comment
Closed

"in" operator fails when array contains a single item #17

jaimz22 opened this issue Aug 7, 2014 · 1 comment
Assignees

Comments

@jaimz22
Copy link

jaimz22 commented Aug 7, 2014

Suppose you have a rule:

$context['var'] = "a";
$rule = 'var in ("a","b")';
$ruler->assert($rule,$context);

This evaluates to true, which is correct.

However if your array has a single item:

$context['var'] = "a";
$rule = 'var in ("a")';
$ruler->assert($rule,$context);

You receive an fatal error:

 PHP Catchable fatal error:  Argument 2 passed to Hoa\Ruler\Visitor\Asserter::Hoa\Ruler\Visitor\{closure}() must be of the type array, string given in /hoa/ruler/Hoa/Ruler/Visitor/Asserter.php on line 112"
@Hywan Hywan added the duplicate label Aug 8, 2014
@Hywan Hywan self-assigned this Aug 8, 2014
@Hywan
Copy link
Member

Hywan commented Aug 8, 2014

Hello :-),

This issue will be fixed when #11 will be fixed. I am closing this issue :-).

@Hywan Hywan closed this as completed Aug 8, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests

2 participants