[Security] Ban \DateTime from Security component

by @WebMamba

Some issues have been detected in this pull request

Issues that can be fixed by applying a patch

Review the proposed patch then download it to apply it manually or execute the following command from the repository root directory:

curl https://fabbot.io/patch/symfony/symfony/47772/86814622de8317e880548402a22cd6378001cf31/cs.diff | patch -p0
diff -ru src/Symfony/Component/Security/Core/Authentication/RememberMe/TokenProviderInterface.php src/Symfony/Component/Security/Core/Authentication/RememberMe/TokenProviderInterface.php
--- src/Symfony/Component/Security/Core/Authentication/RememberMe/TokenProviderInterface.php	2022-10-03 14:55:54.099221813 +0000
+++ src/Symfony/Component/Security/Core/Authentication/RememberMe/TokenProviderInterface.php	2022-10-03 14:55:55.997312634 +0000
@@ -40,7 +40,6 @@
      * @throws TokenNotFoundException if the token is not found
      */
     public function updateToken(string $series, #[\SensitiveParameter] string $tokenValue, \DateTimeInterface $lastUsed);
-
     /**
      * Creates a new token.
      */
diff -ru src/Symfony/Component/Security/Http/RememberMe/PersistentRememberMeHandler.php src/Symfony/Component/Security/Http/RememberMe/PersistentRememberMeHandler.php
--- src/Symfony/Component/Security/Http/RememberMe/PersistentRememberMeHandler.php	2022-10-03 14:55:54.864258419 +0000
+++ src/Symfony/Component/Security/Http/RememberMe/PersistentRememberMeHandler.php	2022-10-03 14:55:56.933357422 +0000
@@ -102,7 +102,7 @@
         }
 
         $rememberMeDetails = RememberMeDetails::fromRawCookie($cookie);
-        [$series, ] = explode(':', $rememberMeDetails->getValue());
+        [$series] = explode(':', $rememberMeDetails->getValue());
         $this->tokenProvider->deleteTokenBySeries($series);
     }
 
diff -ru src/Symfony/Component/Security/Http/Tests/LoginLink/LoginLinkHandlerTest.php src/Symfony/Component/Security/Http/Tests/LoginLink/LoginLinkHandlerTest.php
--- src/Symfony/Component/Security/Http/Tests/LoginLink/LoginLinkHandlerTest.php	2022-10-03 14:55:55.049267271 +0000
+++ src/Symfony/Component/Security/Http/Tests/LoginLink/LoginLinkHandlerTest.php	2022-10-03 14:55:58.811447286 +0000
@@ -53,6 +53,7 @@
 
     /**
      * @group time-sensitive
+     *
      * @dataProvider provideCreateLoginLinkData
      */
     public function testCreateLoginLink($user, array $extraProperties, Request $request = null)

0
Common Typos

0
License Headers

0
Pull Request Contributor Headers

0
File Permissions

0
Merge Commits

0
Exception Messages Formatting

0
Usage of void in test files

0
Use ::class whenever possible

0
Deprecation Messages