@@ -66,7 +66,7 @@ public function dehydrate(object $object): mixed
6666 ->getIdentifierValues ($ object );
6767
6868 // Dehydrate ID values in case they are other entities
69- $ id = array_map (fn ($ id ) => \is_object ($ id ) && $ this ->supports ($ id ::class) ? $ this ->dehydrate ($ id ) : $ id , $ id );
69+ $ id = array_map (fn ($ id ) => \is_object ($ id ) && $ this ->supports ($ id ::class) ? $ this ->dehydrate ($ id ) : $ id , $ id );
7070
7171 switch (\count ($ id )) {
7272 case 0 :
@@ -88,27 +88,23 @@ private function objectManagerFor(string $class): ?ObjectManager
8888
8989 // todo cache/warmup an array of classes that are "doctrine objects"
9090 foreach ($ this ->managerRegistries as $ registry ) {
91-
9291 // The doctrine registry does not resolve aliased interface
9392 // if ($om = $registry->getManagerForClass($class)) {
9493 // return self::ensureManagedObject($om, $class);
9594 // }
96-
9795 foreach ($ registry ->getManagers () as $ om ) {
9896 // But we can resolve nicely by trying to ask each manager to get the metadata
9997 try {
100- if ($ om ->getClassMetadata ($ class ) !== null ) {
98+ if (null !== $ om ->getClassMetadata ($ class )) {
10199 return self ::ensureManagedObject ($ om , $ class );
102100 }
103-
104101 } catch (MappingException $ e ) {
105102 // I did not find a nice way to check if it is because the class is really unknown
106103 // It is good to check for a specific exception ?
107104 // eg: \Doctrine\Persistence\Mapping\MappingException
108105 // Maybe not needed, because it does not failed even when the class does not exist at all
109- // throw $e;
106+ // throw $e;
110107 }
111-
112108 }
113109 }
114110
0 commit comments