Skip to content

Commit 7aa77ab

Browse files
authored
Merge pull request #19 from queueit/bug/php8-internal-funcs-nullable-deprecation
Null check before calling setcookie
2 parents 6c5b87c + 1496993 commit 7aa77ab

File tree

5 files changed

+25
-8
lines changed

5 files changed

+25
-8
lines changed

KnownUser.php

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -423,9 +423,16 @@ public function getCookie($cookieName)
423423

424424
public function setCookie($name, $value, $expire, $domain, $isHttpOnly, $isSecure)
425425
{
426-
if ($domain == null) {
427-
$domain = "";
428-
}
426+
if(is_null($value)){ $value = ""; }
427+
428+
if(is_null($expire)){ $expire = 0; }
429+
430+
if(is_null($domain)){ $domain = ""; }
431+
432+
if(is_null($isHttpOnly)){ $isHttpOnly = false; }
433+
434+
if(is_null($isSecure)){ $isSecure = false; }
435+
429436
setcookie($name, $value, $expire, "/", $domain, $isSecure, $isHttpOnly);
430437
}
431438

Tests/IntegrationConfigHelpersTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -724,8 +724,8 @@ public function getCookie($cookieName) {
724724
}
725725

726726
public function setCookie($name, $value, $expire, $domain, $isCookieHttpOnly, $isCookieSecure) {
727-
if ($domain == NULL) {
728-
$domain = "";
727+
if(is_null($value)){
728+
$value = "";
729729
}
730730
$this->debugInfoCookie = $value;
731731
}

Tests/KnownUserTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ public function getCookie($cookieName)
2121

2222
public function setCookie($name, $value, $expire, $domain, $isCookieHttpOnly, $isCookieSecure)
2323
{
24-
if ($domain == NULL) {
25-
$domain = "";
24+
if(is_null($value)){
25+
$value = "";
2626
}
2727
$this->debugInfoCookie = $value;
2828
}

Tests/UserInQueueStateCookieRepositoryTest.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,16 @@ function __construct() {
1818
}
1919

2020
public function setCookie($cookieName, $value, $expire, $domain, $isHttpOnly, $isSecure) {
21+
if(is_null($value)){ $value = ""; }
22+
23+
if(is_null($expire)){ $expire = 0; }
24+
25+
if(is_null($domain)){ $domain = ""; }
26+
27+
if(is_null($isHttpOnly)){ $isHttpOnly = false; }
28+
29+
if(is_null($isSecure)){ $isSecure = false; }
30+
2131
$this->cookieList[$cookieName] = array(
2232
"name" => $cookieName,
2333
"value" => $value,

UserInQueueService.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class UserInQueueService implements IUserInQueueService
4141
{
4242
public static function getSDKVersion()
4343
{
44-
return "v3-php-" . "3.7.0";
44+
return "v3-php-" . "3.7.1";
4545
}
4646

4747
private $userInQueueStateRepository;

0 commit comments

Comments
 (0)