Skip to content

Commit

Permalink
fix psalm errors
Browse files Browse the repository at this point in the history
  • Loading branch information
TorstenDittmann committed Feb 4, 2021
1 parent 2cf3766 commit 5e9ce43
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
15 changes: 10 additions & 5 deletions src/Analytics/Analytics.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,24 @@

abstract class Analytics
{
protected $enabled = true;
protected bool $enabled = true;

/**
* Enables tracking for this instance.
*
* @return void
*/
public function enable()
public function enable(): void
{
$this->enabled = true;
}

/**
* Disables tracking for this instance.
*
* @return void
*/
public function disable()
public function disable(): void
{
$this->enabled = false;
}
Expand All @@ -40,8 +44,9 @@ public function disable()
*
* @return string
*/
static public function getUniqueByHostname():string {
static public function getUniqueByHostname(): string
{
$host = gethostname();
return md5(gethostbyname($host).$host);
return md5(gethostbyname($host) . $host);
}
}
6 changes: 3 additions & 3 deletions src/Analytics/GoogleAnalytics.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public function __construct(string $tid, string $cid)
* @param string $label
* Specifies the event label.
*
* @param string $value
* @param null|int $value
* Specifies the event value. Values must be non-negative.
*
* @return bool
Expand Down Expand Up @@ -109,7 +109,7 @@ public function createPageView(string $hostname, string $page, string $title = n
return true;
}

private function execute(array $query)
private function execute(array $query): void
{
$ch = curl_init();

Expand All @@ -124,7 +124,7 @@ private function execute(array $query)
curl_close($ch);
}

private function prepareCurl(&$ch, array $query)
private function prepareCurl(&$ch, array $query): void
{
curl_setopt($ch, CURLOPT_URL, self::URL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
Expand Down

0 comments on commit 5e9ce43

Please sign in to comment.