Skip to content

Commit

Permalink
Merge pull request #2 from ARAMISAUTO/fix-userisinpercentage
Browse files Browse the repository at this point in the history
[fix] fix for Feature::isUserInPercentage() method
  • Loading branch information
richardfullmer committed Apr 11, 2014
2 parents 955f463 + 8872d37 commit 473ce1f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Feature.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
*
*
*/

namespace Opensoft\Rollout;
Expand Down Expand Up @@ -183,7 +183,7 @@ public function toArray()
*/
private function isUserInPercentage(RolloutUserInterface $user)
{
return crc32($user->getRolloutIdentifier()) % 100 < $this->percentage;
return abs(crc32($user->getRolloutIdentifier()) % 100) < $this->percentage;
}

/**
Expand All @@ -210,4 +210,4 @@ private function isUserInActiveGroup(RolloutUserInterface $user, Rollout $rollou

return false;
}
}
}

0 comments on commit 473ce1f

Please sign in to comment.