From 564e1934a041de569ed7ed2a91aab639841fd060 Mon Sep 17 00:00:00 2001 From: Alessandro Chitolina Date: Sun, 16 Jun 2019 12:04:09 +0200 Subject: [PATCH] do not use loaded event custom name, as per symfony 4.3 --- lib/Event/ClassMetadataLoadedEvent.php | 2 -- lib/Factory/AbstractMetadataFactory.php | 2 +- tests/Factory/MetadataFactoryTest.php | 3 +-- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/lib/Event/ClassMetadataLoadedEvent.php b/lib/Event/ClassMetadataLoadedEvent.php index 4c78f6a..583484f 100644 --- a/lib/Event/ClassMetadataLoadedEvent.php +++ b/lib/Event/ClassMetadataLoadedEvent.php @@ -7,8 +7,6 @@ class ClassMetadataLoadedEvent extends Event { - public const LOADED_EVENT = 'kcs_metadata.metadata_loaded'; - /** * @var ClassMetadataInterface */ diff --git a/lib/Factory/AbstractMetadataFactory.php b/lib/Factory/AbstractMetadataFactory.php index 5ca4cfa..0a7559b 100644 --- a/lib/Factory/AbstractMetadataFactory.php +++ b/lib/Factory/AbstractMetadataFactory.php @@ -141,7 +141,7 @@ protected function dispatchClassMetadataLoadedEvent(ClassMetadataInterface $clas return; } - $this->eventDispatcher->dispatch(new ClassMetadataLoadedEvent($classMetadata), ClassMetadataLoadedEvent::LOADED_EVENT); + $this->eventDispatcher->dispatch(new ClassMetadataLoadedEvent($classMetadata)); } /** diff --git a/tests/Factory/MetadataFactoryTest.php b/tests/Factory/MetadataFactoryTest.php index 6e7b787..0f41c82 100644 --- a/tests/Factory/MetadataFactoryTest.php +++ b/tests/Factory/MetadataFactoryTest.php @@ -200,8 +200,7 @@ public function get_metadata_for_should_dispatch_loaded_event() $eventDispatcher->dispatch( Argument::that(static function ($arg) use ($that) { return $arg instanceof ClassMetadataLoadedEvent && $arg->getMetadata()->getName() === \get_class($that); - }), - 'kcs_metadata.metadata_loaded' + }) ) ->shouldBeCalled(); $eventDispatcher->addMethodProphecy($eventDispatcher->dispatch(Argument::cetera()));