Skip to content

Commit add5d8b

Browse files
authored
chore: Merge 2.2.1 into release branch for release (#139)
1 parent 2ea1bc3 commit add5d8b

File tree

5 files changed

+18
-4
lines changed

5 files changed

+18
-4
lines changed

CHANGELOG.md

+8
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@ Changes that have landed in master but are not yet released.
44
- refac: Renames notification-center methods. ([#120](https://github.com/optimizely/php-sdk/pull/120))
55
- fix: Validate Inputs for activate/track/getVariation. ([#105](https://github.com/optimizely/php-sdk/pull/105))
66

7+
## 2.2.1
8+
November 14th, 2018
9+
10+
### Bug fixes
11+
- fix(generateBucketValue): Avoid negative bucket number for PHP x86. ([#137](https://github.com/optimizely/php-sdk/pull/137))
12+
- fix(phpdoc-notification-callback): Fixes phpdoc primitive type of notification-callback. ([#135](https://github.com/optimizely/php-sdk/pull/135))
13+
14+
715
## 2.2.0
816
October 29th, 2018
917

src/Optimizely/Bucketer.php

+7-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,13 @@ protected function generateBucketValue($bucketingKey)
8686
{
8787
$hashCode = $this->generateHashCode($bucketingKey);
8888
$ratio = $hashCode / Bucketer::$MAX_HASH_VALUE;
89-
return intval(floor($ratio * Bucketer::$MAX_TRAFFIC_VALUE));
89+
$bucketVal = intval(floor($ratio * Bucketer::$MAX_TRAFFIC_VALUE));
90+
91+
if ($bucketVal < 0) {
92+
$bucketVal += 10000;
93+
}
94+
95+
return $bucketVal;
9096
}
9197

9298
/**

src/Optimizely/Event/Builder/EventBuilder.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class EventBuilder
3737
/**
3838
* @const string Version of the Optimizely PHP SDK.
3939
*/
40-
const SDK_VERSION = '2.2.0';
40+
const SDK_VERSION = '2.2.1';
4141

4242
/**
4343
* @var string URL to send event to.

src/Optimizely/Notification/NotificationCenter.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public function getNotifications()
5959
* Adds a notification callback for a notification type to the notification center
6060
*
6161
* @param string $notification_type One of the constants defined in NotificationType
62-
* @param string $notification_callback A valid PHP callback
62+
* @param callable $notification_callback A valid PHP callback
6363
*
6464
* @return null Given invalid notification type/callback
6565
* -1 Given callback has been already added

tests/EventTests/EventBuilderTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public function setUp()
7373
]],
7474
'revision' => '15',
7575
'client_name' => 'php-sdk',
76-
'client_version' => '2.2.0',
76+
'client_version' => '2.2.1',
7777
'anonymize_ip'=> false,
7878
];
7979
$this->expectedEventHttpVerb = 'POST';

0 commit comments

Comments
 (0)