protected function dispatchClassMetadataLoadedEvent(ClassMetadataInterface $classMetadata): void
    {
        if (null === $this->eventDispatcher) {
            return;
        }

        $this->eventDispatcher->dispatch(
            ClassMetadataLoadedEvent::LOADED_EVENT,
            new ClassMetadataLoadedEvent($classMetadata)
        );
    }