-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
5 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -159,7 +159,7 @@ class MatomoTracker | |
public $configReferralCookieTimeout = 15768000; // 6 months | ||
|
||
// Visitor Ids in order | ||
public $userId = false; | ||
public $userId = null; | ||
|
||
public $forcedVisitorId = false; | ||
|
||
|
@@ -1571,11 +1571,11 @@ public function setIp(string $ip) | |
* | ||
* A User ID can be a username, UUID or an email address, or any number or string that uniquely identifies a user or client. | ||
* | ||
* @param string $userId Any user ID string (eg. email address, ID, username). Must be non empty. Set to false to de-assign a user id previously set. | ||
* @param string|null $userId Any user ID string (eg. email address, ID, username). Must be non empty. Set to null to de-assign a user id previously set. | ||
* @return $this | ||
* @throws Exception | ||
*/ | ||
public function setUserId(string $userId) | ||
public function setUserId(?string $userId) | ||
{ | ||
if ($userId === '') { | ||
throw new Exception("User ID cannot be empty."); | ||
|
@@ -1674,9 +1674,9 @@ public function getIp() | |
* Returns the User ID string, which may have been set via: | ||
* $v->setUserId('[email protected]'); | ||
* | ||
* @return bool | ||
* @return string|null | ||
*/ | ||
public function getUserId() | ||
public function getUserId(): ?string | ||
{ | ||
return $this->userId; | ||
} | ||
|