Doctrine 3.0.2 fatal error on flush PreUpdate must be of type LifecycleEventArgs, PreUpdateEventArgs given

I just updated Doctrine to the last version 3.0.2 and when I try to do a simple flush:

global $entityManager;
$entity = $this->getRepository()->findByUID($uid);
        
if(!$entity) {
    $entity = parent::createNewEntity();
    $entity->setUid($uid);
}

$entity->setSuperHashDate($dateTime);
$entity->setSalt($salt);
$entity->setSuperHash($superHash);

$entityManager->flush();

It returns the following error:

AH01071: Got error ‘PHP message: PHP Fatal error: Uncaught TypeError:
DoctrineEventSubscriber::preUpdate(): Argument #1 ($args) must be of
type DoctrineORMEventLifecycleEventArgs,
DoctrineORMEventPreUpdateEventArgs given, called in
/home/framework/public_html/app/_core/libs/vendor/doctrine/event-manager/src/EventManager.php
on line 41 and defined in
/home/framework/public_html/app/_core/events/subscribers/DoctrineEventSubscriber.php:23
Stack trace:

#0 /app/libs/vendor/doctrine/event-manager/src/EventManager.php(41): DoctrineEventSubscriber->preUpdate()

#1 /app/libs/vendor/doctrine/orm/src/Event/ListenersInvoker.php(95): DoctrineCommonEventManager->dispatchEvent()

#2 /app/libs/vendor/doctrine/orm/src/UnitOfWork.php(1120): DoctrineORMEventListenersInvoker->invoke()

#3 /app/libs/vendor/doctrine/orm/src/UnitOfWork.php(404): DoctrineORMUnitOfWork->executeUpdates()