10
10
namespace Gedmo \Loggable ;
11
11
12
12
use Doctrine \Common \EventArgs ;
13
- use Doctrine \ORM \Mapping \ClassMetadata ;
13
+ use Doctrine \ORM \Mapping \ClassMetadata as ORMClassMetadata ;
14
14
use Doctrine \Persistence \Event \LoadClassMetadataEventArgs ;
15
+ use Doctrine \Persistence \Mapping \ClassMetadata ;
15
16
use Doctrine \Persistence \ObjectManager ;
16
17
use Gedmo \Exception \InvalidArgumentException ;
17
18
use Gedmo \Loggable \Entity \LogEntry ;
@@ -125,6 +126,7 @@ public function getSubscribedEvents()
125
126
* Maps additional metadata
126
127
*
127
128
* @param LoadClassMetadataEventArgs $eventArgs
129
+ * @phpstan-param LoadClassMetadataEventArgs<ClassMetadata<object>, ObjectManager> $eventArgs
128
130
*
129
131
* @return void
130
132
*/
@@ -312,7 +314,7 @@ protected function createLogEntry($action, $object, LoggableAdapter $ea)
312
314
if ($ config = $ this ->getConfiguration ($ om , $ meta ->getName ())) {
313
315
$ logEntryClass = $ this ->getLogEntryClass ($ ea , $ meta ->getName ());
314
316
$ logEntryMeta = $ om ->getClassMetadata ($ logEntryClass );
315
- /** @var LogEntryInterface $logEntry */
317
+ /** @var LogEntryInterface<T> $logEntry */
316
318
$ logEntry = $ logEntryMeta ->newInstance ();
317
319
318
320
$ logEntry ->setAction ($ action );
@@ -322,7 +324,7 @@ protected function createLogEntry($action, $object, LoggableAdapter $ea)
322
324
323
325
// check for the availability of the primary key
324
326
$ 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 ))) {
326
328
$ this ->pendingLogEntryInserts [spl_object_id ($ object )] = $ logEntry ;
327
329
} else {
328
330
$ logEntry ->setObjectId ($ wrapped ->getIdentifier (false , true ));
0 commit comments