Skip to content

Commit

Permalink
134 - delete self return type
Browse files Browse the repository at this point in the history
  • Loading branch information
alutskevich committed Jun 3, 2024
1 parent 9673f8a commit 1d63c68
Showing 1 changed file with 38 additions and 38 deletions.
76 changes: 38 additions & 38 deletions MatomoTracker.php
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ public function setApiUrl(string $url): void
*
* @return $this
*/
public function setPageCharset(string $charset = ''): self
public function setPageCharset(string $charset = '')
{
$this->pageCharset = $charset;

Expand All @@ -263,7 +263,7 @@ public function setPageCharset(string $charset = ''): self
* @param string $url Raw URL (not URL encoded)
* @return $this
*/
public function setUrl(string $url): self
public function setUrl(string $url)
{
$this->pageUrl = $url;

Expand All @@ -276,7 +276,7 @@ public function setUrl(string $url): self
* @param string $url Raw URL (not URL encoded)
* @return $this
*/
public function setUrlReferrer(string $url): self
public function setUrlReferrer(string $url)
{
$this->urlReferrer = $url;

Expand All @@ -292,7 +292,7 @@ public function setUrlReferrer(string $url): self
* @deprecated this metric is deprecated please use performance timings instead
* @see setPerformanceTimings
*/
public function setGenerationTime(int $timeMs): self
public function setGenerationTime(int $timeMs)
{
return $this;
}
Expand All @@ -316,7 +316,7 @@ public function setPerformanceTimings(
?int $domProcessing = null,
?int $domCompletion = null,
?int $onload = null
): self {
) {
$this->networkTime = $network;
$this->serverTime = $server;
$this->transferTime = $transfer;
Expand Down Expand Up @@ -344,7 +344,7 @@ public function clearPerformanceTimings(): void
* @deprecated
* @ignore
*/
public function setUrlReferer(string $url): self
public function setUrlReferer(string $url)
{
$this->setUrlReferrer($url);

Expand All @@ -366,7 +366,7 @@ public function setUrlReferer(string $url): self
* @throws Exception
* @see function getAttributionInfo() in https://github.com/matomo-org/matomo/blob/master/js/matomo.js
*/
public function setAttributionInfo(string $jsonEncoded): self
public function setAttributionInfo(string $jsonEncoded)
{
$decoded = json_decode($jsonEncoded, $assoc = true);
if (!is_array($decoded)) {
Expand All @@ -393,7 +393,7 @@ public function setCustomVariable(
string $name,
string $value,
string $scope = 'visit'
): self {
) {
if ($scope === 'page') {
$this->pageCustomVar[$id] = array($name, $value);
} elseif ($scope === 'event') {
Expand Down Expand Up @@ -469,7 +469,7 @@ public function clearCustomVariables(): void
* @param string $value value for custom dimension
* @return $this
*/
public function setCustomDimension(int $id, string $value): self
public function setCustomDimension(int $id, string $value)
{
$this->customDimensions['dimension'.$id] = $value;

Expand Down Expand Up @@ -505,7 +505,7 @@ public function getCustomDimension(int $id): ?string
* @return $this
* @throws Exception
*/
public function setCustomTrackingParameter(string $trackingApiParameter, string $value): self
public function setCustomTrackingParameter(string $trackingApiParameter, string $value)
{
$matches = [];

Expand All @@ -532,7 +532,7 @@ public function clearCustomTrackingParameters(): void
* Sets the current visitor ID to a random new one.
* @return $this
*/
public function setNewVisitorId(): self
public function setNewVisitorId()
{
$this->randomVisitorId = substr(md5(uniqid(rand(), true)), 0, self::LENGTH_VISITOR_ID);
$this->forcedVisitorId = false;
Expand All @@ -546,7 +546,7 @@ public function setNewVisitorId(): self
*
* @return $this
*/
public function setIdSite(int $idSite): self
public function setIdSite(int $idSite)
{
$this->idSite = $idSite;

Expand All @@ -559,7 +559,7 @@ public function setIdSite(int $idSite): self
* @param string $acceptLanguage For example "fr-fr"
* @return $this
*/
public function setBrowserLanguage(string $acceptLanguage): self
public function setBrowserLanguage(string $acceptLanguage)
{
$this->acceptLanguage = $acceptLanguage;

Expand All @@ -573,7 +573,7 @@ public function setBrowserLanguage(string $acceptLanguage): self
* @param string $userAgent
* @return $this
*/
public function setUserAgent(string $userAgent): self
public function setUserAgent(string $userAgent)
{
$this->userAgent = $userAgent;

Expand Down Expand Up @@ -602,7 +602,7 @@ public function setClientHints(
string $platformVersion = '',
$fullVersionList = '',
string $uaFullVersion = ''
): self {
) {
if (is_string($fullVersionList)) {
$reg = '/^"([^"]+)"; ?v="([^"]+)"(?:, )?/';
$list = [];
Expand Down Expand Up @@ -636,7 +636,7 @@ public function setClientHints(
*
* @return $this
*/
public function setCountry(string $country): self
public function setCountry(string $country)
{
$this->country = $country;

Expand All @@ -651,7 +651,7 @@ public function setCountry(string $country): self
*
* @return $this
*/
public function setRegion(string $region): self
public function setRegion(string $region)
{
$this->region = $region;

Expand All @@ -666,7 +666,7 @@ public function setRegion(string $region): self
*
* @return $this
*/
public function setCity(string $city): self
public function setCity(string $city)
{
$this->city = $city;

Expand All @@ -681,7 +681,7 @@ public function setCity(string $city): self
*
* @return $this
*/
public function setLatitude(float $lat): self
public function setLatitude(float $lat)
{
$this->lat = $lat;

Expand All @@ -696,7 +696,7 @@ public function setLatitude(float $lat): self
*
* @return $this
*/
public function setLongitude(float $long): self
public function setLongitude(float $long)
{
$this->long = $long;

Expand Down Expand Up @@ -968,7 +968,7 @@ public function addEcommerceItem(
$category = '',
$price = 0.0,
int $quantity = 1
): self {
) {
if (empty($sku)) {
throw new Exception("You must specify a SKU for the Ecommerce item");
}
Expand Down Expand Up @@ -1146,7 +1146,7 @@ public function setEcommerceView(
string $name = '',
$category = '',
float $price = 0.0
): self {
) {
$this->ecommerceView = [];

if (!empty($category)) {
Expand Down Expand Up @@ -1513,7 +1513,7 @@ public function getUrlTrackCrash(
* If the datetime is older than one day (default value for tracking_requests_require_authentication_when_custom_timestamp_newer_than), then you must call setTokenAuth() with a valid Admin/Super user token.
* @return $this
*/
public function setForceVisitDateTime(string $dateTime): self
public function setForceVisitDateTime(string $dateTime)
{
$this->forcedDatetime = $dateTime;

Expand All @@ -1527,7 +1527,7 @@ public function setForceVisitDateTime(string $dateTime): self
* If you call setForceNewVisit() before calling doTrack*, then a new visit will be created for this request.
* @return $this
*/
public function setForceNewVisit(): self
public function setForceNewVisit()
{
$this->forcedNewVisit = true;

Expand All @@ -1542,7 +1542,7 @@ public function setForceNewVisit(): self
* @param string $ip IP string, eg. 130.54.2.1
* @return $this
*/
public function setIp(string $ip): self
public function setIp(string $ip)
{
$this->ip = $ip;

Expand All @@ -1558,7 +1558,7 @@ public function setIp(string $ip): self
* @return $this
* @throws Exception
*/
public function setUserId(string $userId): self
public function setUserId(string $userId)
{
if ($userId === '') {
throw new Exception("User ID cannot be empty.");
Expand Down Expand Up @@ -1592,7 +1592,7 @@ public static function getUserIdHashed($id): string
* @return $this
* @throws Exception
*/
public function setVisitorId(string $visitorId): self
public function setVisitorId(string $visitorId)
{
$hexChars = '01234567890abcdefABCDEF';
if (strlen($visitorId) !== self::LENGTH_VISITOR_ID
Expand Down Expand Up @@ -1729,7 +1729,7 @@ public function getAttributionInfo()
* @param string $token_auth token_auth 32 chars token_auth string
* @return $this
*/
public function setTokenAuth(string $token_auth): self
public function setTokenAuth(string $token_auth)
{
$this->token_auth = $token_auth;

Expand All @@ -1742,7 +1742,7 @@ public function setTokenAuth(string $token_auth): self
* @param string $time HH:MM:SS format
* @return $this
*/
public function setLocalTime(string $time): self
public function setLocalTime(string $time)
{
[$hour, $minute, $second] = explode(':', $time);
$this->localHour = (int)$hour;
Expand All @@ -1759,7 +1759,7 @@ public function setLocalTime(string $time): self
* @param int $height
* @return $this
*/
public function setResolution(int $width, int $height): self
public function setResolution(int $width, int $height)
{
$this->width = $width;
$this->height = $height;
Expand All @@ -1773,7 +1773,7 @@ public function setResolution(int $width, int $height): self
*
* @return $this
*/
public function setBrowserHasCookies(bool $hasCookies): self
public function setBrowserHasCookies(bool $hasCookies)
{
$this->hasCookies = $hasCookies;

Expand All @@ -1785,7 +1785,7 @@ public function setBrowserHasCookies(bool $hasCookies): self
*
* @return $this
*/
public function setDebugStringAppend(string $debugString): self
public function setDebugStringAppend(string $debugString)
{
$this->DEBUG_APPEND_URL = '&' . $debugString;

Expand All @@ -1805,7 +1805,7 @@ public function setPlugins(
bool $pdf = false,
bool $windowsMedia = false,
bool $silverlight = false
): self {
) {
$this->plugins =
'&fla=' . (int)$flash .
'&java=' . (int)$java .
Expand Down Expand Up @@ -1844,7 +1844,7 @@ public function getRequestTimeout(): int
* @return $this
* @throws Exception
*/
public function setRequestTimeout(int $timeout): self
public function setRequestTimeout(int $timeout)
{
if ($timeout < 0) {
throw new Exception("Invalid value supplied for request timeout: $timeout");
Expand All @@ -1871,7 +1871,7 @@ public function getRequestConnectTimeout(): int
* @return $this
* @throws Exception
*/
public function setRequestConnectTimeout(int $timeout): self
public function setRequestConnectTimeout(int $timeout)
{
if ($timeout < 0) {
throw new Exception("Invalid value supplied for request connect timeout: $timeout");
Expand All @@ -1891,7 +1891,7 @@ public function setRequestConnectTimeout(int $timeout): self
* @param string $method Either 'POST' or 'GET'
* @return $this
*/
public function setRequestMethodNonBulk(string $method): self
public function setRequestMethodNonBulk(string $method)
{
$this->requestMethod = strtoupper($method) === 'POST' ? 'POST' : 'GET';

Expand Down Expand Up @@ -2417,7 +2417,7 @@ protected static function getCurrentUrl(): string
* All cookies are supported: 'id' and 'ses' and 'ref' and 'cvar' cookies.
* @return $this
*/
protected function setFirstPartyCookies(): self
protected function setFirstPartyCookies()
{
if ($this->configCookiesDisabled) {
return $this;
Expand Down Expand Up @@ -2452,7 +2452,7 @@ protected function setFirstPartyCookies(): self
*
* @return $this
*/
protected function setCookie(string $cookieName, $cookieValue, int $cookieTTL): self
protected function setCookie(string $cookieName, $cookieValue, int $cookieTTL)
{
$cookieExpire = $this->currentTs + $cookieTTL;
if (!headers_sent()) {
Expand Down

0 comments on commit 1d63c68

Please sign in to comment.