src/Domain/Repository/Identity/AdministratorTokenRepository.php
public function removeExpired(): int
    {
        $queryBuilder = $this->getEntityManager()->createQueryBuilder();
        $queryBuilder->delete(AdministratorToken::class, 'token')->where('token.expiry <= CURRENT_TIMESTAMP()');

        return (int)$queryBuilder->getQuery()->execute();
    }
public function removeExpired(): int
    {
        $queryBuilder = $this->getEntityManager()->createQueryBuilder();
        $queryBuilder->delete(AdministratorToken::class, 'token')->where('token.expiry <= CURRENT_TIMESTAMP()');

        return (int)$queryBuilder->getQuery()->execute();
    }
public function removeExpired ( ) : int { $ queryBuilder = $ this -> getEntityManager ( ) -> createQueryBuilder ( ) ; $ queryBuilder -> delete ( AdministratorToken :: class , 'token' ) -> where ( 'token.expiry <= CURRENT_TIMESTAMP()' ) ; return ( int ) $ queryBuilder -> getQuery ( ) -> execute ( ) ; }
Removes all expired tokens.

This method should be called regularly to clean up the tokens.

@return int the number of removed tokens
Removes all expired tokens .