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

New mutator for bcmath #678

Merged
merged 7 commits into from Apr 20, 2019
Merged

Conversation

majkel89
Copy link
Contributor

@majkel89 majkel89 commented Mar 30, 2019

This PR:

Fixes #658

Supported functions:

  • bcadd($a, $b, $mod) -> (string) ($a + $b)
  • bcdiv($a, $b, $mod) -> (string) ($a / $b)
  • bcmod($a, $b, $mod) -> (string) ($a % $b)
  • bcmul($a, $b, $mod) -> (string) ($a * $b)
  • bcpow($a, $b, $mod) -> (string) ($a ** $b)
  • bcsub($a, $b, $mod) -> (string) ($a - $b)
  • bcsqrt($a, $mod) -> (string) sqrt($a)
  • bcpowmod($a, $b, $c, $mod) -> (string) (pow($a, $b) % $c)
  • bccomp($a, $b, $mod) -> $a <=> $b

New profile @extensions created to hold this mutator. It is on by default.

Configuration

"mutators": {
  "BCMath": {
    "settings": {
      "bcpowmod": false,
      "bcsqrt": false,
    }
  }
},

@maks-rafalko maks-rafalko self-requested a review Mar 30, 2019
Copy link
Member

@maks-rafalko maks-rafalko left a comment

Thanks for creating the second awesome PR and adding support for extensions 👍

A couple of comments to discuss

src/Mutator/Extensions/BCMath.php Outdated Show resolved Hide resolved
src/Mutator/Util/MutatorProfile.php Outdated Show resolved Hide resolved
composer.json Outdated Show resolved Hide resolved
devTools/Dockerfile-php71-xdebug Outdated Show resolved Hide resolved
@maks-rafalko maks-rafalko added this to the 0.13.0 milestone Apr 1, 2019
maks-rafalko
maks-rafalko previously approved these changes Apr 2, 2019
Copy link
Member

@maks-rafalko maks-rafalko left a comment

👌

@maks-rafalko maks-rafalko requested a review from sanmai Apr 4, 2019
src/Mutator/Extensions/BCMath.php Outdated Show resolved Hide resolved
@sanmai sanmai self-requested a review Apr 14, 2019
sanmai
sanmai approved these changes Apr 18, 2019
Copy link
Member

@sanmai sanmai left a comment

Seems like this is it. Great work!

Copy link
Member

@maks-rafalko maks-rafalko left a comment

Thank you @majkel89 for your work and patience, really appreciate it. Great mutator!

@maks-rafalko maks-rafalko merged commit 91f568d into infection:master Apr 20, 2019
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants