bobthecow / Ruler

A simple stateless production rules engine for modern PHP
MIT License
1.06k stars 140 forks source link

A warning in php7.2 by count() #55

Closed boxsky closed 6 years ago

boxsky commented 6 years ago

In file Ruler/src/Ruler/Operator/PropositionOperator.php line 30 . count() function was changed more strict. can use function fun_adm_count($array_or_countable,$mode = COUNT_NORMAL){ if(is_array($array_or_countable) || is_object($array_or_countable)){ return count($array_or_countable, $mode); }else{ return 0; } } or other way to fix it.

mahagr commented 6 years ago

@dame001 I have updated version of the library here: https://github.com/mahagr/Ruler/tree/feature/variable_method

It may still have some bugs, but it's designed to work on PHP 5.6+ and has some additional features which may be useful.

boxsky commented 6 years ago

@mahagr thanks a lot!It‘s looks good! R u use it in your project? Hope u can perfect it! had started!

mahagr commented 6 years ago

Right now I'm not using this new version, but I have plans to use it in the future (I am still using an older version of the code). It needs still some testing. :)