/**
* @param \DateTimeInterface $lastUsed Accepting only DateTime is deprecated since Symfony 6.4
*
* @return void
*/
public function updateToken(string
$series, #[\SensitiveParameter] string $tokenValue, \DateTime $lastUsed)
{ $sql = 'UPDATE rememberme_token SET value=:value, lastUsed=:lastUsed WHERE series=:series';
$paramValues =
[ 'value' =>
$tokenValue,
'lastUsed' => \DateTimeImmutable::
createFromInterface($lastUsed),
'series' =>
$series,
];
$paramTypes =
[ 'value' => ParameterType::STRING,
'lastUsed' => Types::DATETIME_IMMUTABLE,
'series' => ParameterType::STRING,
];
$updated =
$this->conn->
executeStatement($sql,
$paramValues,
$paramTypes);
if ($updated < 1
) { throw new TokenNotFoundException('No token found.'
);
} }