-
-
Notifications
You must be signed in to change notification settings - Fork 3
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 comparisons #3
base: master
Are you sure you want to change the base?
Conversation
andru@developer-a ~/Web/www/bcmath $ phpunit -v --color -c .travis-phpunit.xml Runtime: PHP 5.6.30-11+deb.sury.org~trusty+3 with Xdebug 2.5.1 ....................... 23 / 23 (100%) Time: 8.48 seconds, Memory: 6.00MB OK (23 tests, 72 assertions) Generating code coverage report in Clover XML format ... done https://www.dropbox.com/s/bm7stcnli109k9p/%D1%81%D0%BD%D0%B8%D0%BC%D0%BE%D0%BA50.png?dl=0 |
Please check coverage parser because if i run PHPUnit coverage in local machine i see 100% |
I actually want to do this a slightly different way; I just haven't had a moment to sit down and do it. I was originally a bit worried about how boolean operations would be processed if there were more than one in an expression, but I figured it wouldn't be a feature used very often, so I didn't bother improving the implementation at the time. This PR reminded me I still hadn't addressed that, and apparently it's a useful feature after all, so I'm gonna sit down and make it happen soon. Just haven't gotten there, yet. I'll leave this open to remind me to follow through. Should have said something sooner, actually. Sorry about that. |
Can i use this logic in my project? After you make the logic in your own, will I be able to use your code without changes in my project? |
I don't see why not. It will output the same way. The only differences will be in exactly how the parser handles booleans, that's all. |
Up. This fix is actual now. |
$res = BC::parse('0 | 0'); var_dump($res);
Old version:
Replacing 0|0 with in the (0|0) section of (0|0)
Replacing (0|0) with in (0|0)
string(0) ""
New version:
Replacing 0|0 with 0 in the (0|0) section of (0|0)
Replacing (0|0) with 0 in (0|0)
string(1) "0"
if i add some logic to parse:
$isPlayed = BC::parse('{totalMoney} <= {playedMoney} | {balance} <= 1' , [ 'totalMoney' => $bonusUser->totalMoney, 'playedMoney' => $bonusUser->playedMoney, 'balance' => $financeClient->balance ], 2, true); var_dump($res);