Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions MatomoTracker.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ class MatomoTracker
*/
public function __construct($idSite, $apiUrl = '')
{
$this->ecommerceItems = array();
$this->ecommerceItems = [];
$this->attributionInfo = false;
$this->eventCustomVar = false;
$this->eventCustomVar = [];
$this->forcedDatetime = false;
$this->forcedNewVisit = false;
$this->networkTime = false;
Expand All @@ -93,10 +93,10 @@ public function __construct($idSite, $apiUrl = '')
$this->domProcessingTime = false;
$this->domCompletionTime = false;
$this->onLoadTime = false;
$this->pageCustomVar = false;
$this->ecommerceView = array();
$this->customParameters = array();
$this->customDimensions = array();
$this->pageCustomVar = [];
$this->ecommerceView = [];
$this->customParameters = [];
$this->customDimensions = [];
$this->customData = false;
$this->hasCookies = false;
$this->token_auth = false;
Expand Down Expand Up @@ -153,14 +153,14 @@ public function __construct($idSite, $apiUrl = '')
// Allow debug while blocking the request
$this->requestTimeout = 600;
$this->doBulkRequests = false;
$this->storedTrackingActions = array();
$this->storedTrackingActions = [];

$this->sendImageResponse = true;

$this->visitorCustomVar = $this->getCustomVariablesFromCookie();

$this->outgoingTrackerCookies = array();
$this->incomingTrackerCookies = array();
$this->outgoingTrackerCookies = [];
$this->incomingTrackerCookies = [];
}

/**
Expand Down Expand Up @@ -365,9 +365,9 @@ public function getCustomVariable($id, $scope = 'visit')
*/
public function clearCustomVariables()
{
$this->visitorCustomVar = array();
$this->pageCustomVar = array();
$this->eventCustomVar = array();
$this->visitorCustomVar = [];
$this->pageCustomVar = [];
$this->eventCustomVar = [];
}

/**
Expand Down Expand Up @@ -2105,13 +2105,13 @@ protected function setCookie($cookieName, $cookieValue, $cookieTTL)
}

/**
* @return bool|mixed
* @return array
*/
protected function getCustomVariablesFromCookie()
{
$cookie = $this->getCookieMatchingName('cvar');
if (!$cookie) {
return false;
return [];
}

return json_decode($cookie, $assoc = true);
Expand Down