1010namespace Gedmo \Loggable ;
1111
1212use Doctrine \Common \EventArgs ;
13- use Doctrine \ORM \Mapping \ClassMetadata ;
13+ use Doctrine \ORM \Mapping \ClassMetadata as ORMClassMetadata ;
1414use Doctrine \Persistence \Event \LoadClassMetadataEventArgs ;
15+ use Doctrine \Persistence \Mapping \ClassMetadata ;
1516use Doctrine \Persistence \ObjectManager ;
1617use Gedmo \Exception \InvalidArgumentException ;
1718use Gedmo \Loggable \Entity \LogEntry ;
@@ -125,6 +126,7 @@ public function getSubscribedEvents()
125126 * Maps additional metadata
126127 *
127128 * @param LoadClassMetadataEventArgs $eventArgs
129+ * @phpstan-param LoadClassMetadataEventArgs<ClassMetadata<object>, ObjectManager> $eventArgs
128130 *
129131 * @return void
130132 */
@@ -312,7 +314,7 @@ protected function createLogEntry($action, $object, LoggableAdapter $ea)
312314 if ($ config = $ this ->getConfiguration ($ om , $ meta ->getName ())) {
313315 $ logEntryClass = $ this ->getLogEntryClass ($ ea , $ meta ->getName ());
314316 $ logEntryMeta = $ om ->getClassMetadata ($ logEntryClass );
315- /** @var LogEntryInterface $logEntry */
317+ /** @var LogEntryInterface<T> $logEntry */
316318 $ logEntry = $ logEntryMeta ->newInstance ();
317319
318320 $ logEntry ->setAction ($ action );
@@ -322,7 +324,7 @@ protected function createLogEntry($action, $object, LoggableAdapter $ea)
322324
323325 // check for the availability of the primary key
324326 $ uow = $ om ->getUnitOfWork ();
325- if (LogEntryInterface::ACTION_CREATE === $ action && ($ ea ->isPostInsertGenerator ($ meta ) || ($ meta instanceof ClassMetadata && $ meta ->isIdentifierComposite ))) {
327+ if (LogEntryInterface::ACTION_CREATE === $ action && ($ ea ->isPostInsertGenerator ($ meta ) || ($ meta instanceof ORMClassMetadata && $ meta ->isIdentifierComposite ))) {
326328 $ this ->pendingLogEntryInserts [spl_object_id ($ object )] = $ logEntry ;
327329 } else {
328330 $ logEntry ->setObjectId ($ wrapped ->getIdentifier (false , true ));
0 commit comments