File tree 5 files changed +18
-4
lines changed
5 files changed +18
-4
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,14 @@ Changes that have landed in master but are not yet released.
4
4
- refac: Renames notification-center methods. ([ #120 ] ( https://github.com/optimizely/php-sdk/pull/120 ) )
5
5
- fix: Validate Inputs for activate/track/getVariation. ([ #105 ] ( https://github.com/optimizely/php-sdk/pull/105 ) )
6
6
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
+
7
15
## 2.2.0
8
16
October 29th, 2018
9
17
Original file line number Diff line number Diff line change @@ -86,7 +86,13 @@ protected function generateBucketValue($bucketingKey)
86
86
{
87
87
$ hashCode = $ this ->generateHashCode ($ bucketingKey );
88
88
$ 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 ;
90
96
}
91
97
92
98
/**
Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ class EventBuilder
37
37
/**
38
38
* @const string Version of the Optimizely PHP SDK.
39
39
*/
40
- const SDK_VERSION = '2.2.0 ' ;
40
+ const SDK_VERSION = '2.2.1 ' ;
41
41
42
42
/**
43
43
* @var string URL to send event to.
Original file line number Diff line number Diff line change @@ -59,7 +59,7 @@ public function getNotifications()
59
59
* Adds a notification callback for a notification type to the notification center
60
60
*
61
61
* @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
63
63
*
64
64
* @return null Given invalid notification type/callback
65
65
* -1 Given callback has been already added
Original file line number Diff line number Diff line change @@ -73,7 +73,7 @@ public function setUp()
73
73
]],
74
74
'revision ' => '15 ' ,
75
75
'client_name ' => 'php-sdk ' ,
76
- 'client_version ' => '2.2.0 ' ,
76
+ 'client_version ' => '2.2.1 ' ,
77
77
'anonymize_ip ' => false ,
78
78
];
79
79
$ this ->expectedEventHttpVerb = 'POST ' ;
You can’t perform that action at this time.
0 commit comments