From 843f036de5088ad14280c22a0a32cfce6d658ada Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marko=20Ivan=C4=8Di=C4=87?= <marko.ivancic@srce.hr>
Date: Mon, 6 Feb 2023 12:20:29 +0100
Subject: [PATCH] Fix psalm errors

---
 src/Helpers/NetworkHelper.php                         |  1 -
 src/ModuleConfiguration.php                           |  1 -
 .../Authentication/DoctrineDbal/Versioned/Tracker.php | 11 -----------
 3 files changed, 13 deletions(-)

diff --git a/src/Helpers/NetworkHelper.php b/src/Helpers/NetworkHelper.php
index d7159a4..8fa60ff 100644
--- a/src/Helpers/NetworkHelper.php
+++ b/src/Helpers/NetworkHelper.php
@@ -8,7 +8,6 @@ class NetworkHelper
 {
     public function resolveClientIpAddress(string $clientIpAddress = null): ?string
     {
-        /** @var string|null $clientIpAddress */
         $clientIpAddress = $clientIpAddress ??
             $_SERVER['HTTP_CLIENT_IP'] ??
             $_SERVER['HTTP_X_FORWARDED_FOR'] ??
diff --git a/src/ModuleConfiguration.php b/src/ModuleConfiguration.php
index fe83f63..453d1b9 100644
--- a/src/ModuleConfiguration.php
+++ b/src/ModuleConfiguration.php
@@ -465,7 +465,6 @@ class ModuleConfiguration
 
     public function getTrackerDataRetentionPolicy(): ?DateInterval
     {
-        /** @var string|null $value */
         $value = $this->getConfiguration()
             ->getOptionalString(self::OPTION_TRACKER_DATA_RETENTION_POLICY, null);
 
diff --git a/src/Trackers/Authentication/DoctrineDbal/Versioned/Tracker.php b/src/Trackers/Authentication/DoctrineDbal/Versioned/Tracker.php
index a3e2076..4a9c431 100644
--- a/src/Trackers/Authentication/DoctrineDbal/Versioned/Tracker.php
+++ b/src/Trackers/Authentication/DoctrineDbal/Versioned/Tracker.php
@@ -99,17 +99,6 @@ class Tracker implements AuthenticationDataTrackerInterface, AuthenticationDataP
     {
         $dateTime = (new DateTimeImmutable())->sub($retentionPolicy);
 
-        if ($dateTime === false) {
-            // @codeCoverageIgnoreStart
-            $message = sprintf(
-                'Could not create DateTime instance for data retention policy enforcement. Retention policy was: %s.',
-                var_export($retentionPolicy, true)
-            );
-            $this->logger->error($message);
-            throw new InvalidConfigurationException($message);
-            // @codeCoverageIgnoreEnd
-        }
-
         $this->dataStore->deleteDataOlderThan($dateTime);
     }
 }
-- 
GitLab