-
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
10 additions
and
10 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 |
---|---|---|
|
@@ -105,7 +105,7 @@ class MatomoTracker | |
|
||
public $hasCookies = false; | ||
|
||
public $token_auth = false; | ||
public $token_auth = null; | ||
|
||
public $userAgent = false; | ||
|
||
|
@@ -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; | ||
} | ||
|
@@ -1743,10 +1743,10 @@ public function getAttributionInfo() | |
* - force the visitor IP | ||
* - force the date & time of the tracking requests rather than track for the current datetime | ||
* | ||
* @param string $token_auth token_auth 32 chars token_auth string | ||
* @param string|null $token_auth token_auth 32 chars token_auth string | ||
* @return $this | ||
*/ | ||
public function setTokenAuth(string $token_auth) | ||
public function setTokenAuth(?string $token_auth) | ||
{ | ||
$this->token_auth = $token_auth; | ||
|
||
|
@@ -2052,7 +2052,7 @@ protected function prepareStreamOptions(string $method, $data, bool $forcePostUr | |
/** | ||
* @ignore | ||
*/ | ||
protected function sendRequest(string $url, string $method = 'GET', $data = null, bool $force = false): string | ||
protected function sendRequest(string $url, string $method = 'GET', $data = null, bool $force = false) | ||
{ | ||
self::$DEBUG_LAST_REQUESTED_URL = $url; | ||
|
||
|
@@ -2114,7 +2114,7 @@ protected function sendRequest(string $url, string $method = 'GET', $data = null | |
curl_setopt_array($ch, $options); | ||
ob_start(); | ||
$response = @curl_exec($ch); | ||
|
||
try { | ||
$header = ''; | ||
|
||
|