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

Fatal error with Bool variables and || #24

Open
stavultras opened this issue Oct 6, 2022 · 0 comments
Open

Fatal error with Bool variables and || #24

stavultras opened this issue Oct 6, 2022 · 0 comments

Comments

@stavultras
Copy link

stavultras commented Oct 6, 2022

There is a PHP fatal error when === false/true isn't added after "boolean" functions.

Version: 0.7.1
PHP version: 8.1
How to replicate:

$engine_rule = new Rule('VAR.startsWith("xXx") || VAR.startsWith("xXx") === false', ['VAR' => 'blablabla']);
$engine_rule->isTrue();

Expected result: Validation error like "invalid token || blablabla" until === false/true is added.
Actual result: nicoSWD\Rule\Expression\ExpressionFactory::createFromOperator(): Argument #1 ($operator) must be of type nicoSWD\Rule\TokenStream\Token\BaseToken, null given, called in libs\php-rule-parser\src\Parser\Parser.php on line 61

Thank you.

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

No branches or pull requests

1 participant