@@ -66,7 +66,7 @@ public function dehydrate(object $object): mixed
66
66
->getIdentifierValues ($ object );
67
67
68
68
// 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 );
70
70
71
71
switch (\count ($ id )) {
72
72
case 0 :
@@ -88,27 +88,23 @@ private function objectManagerFor(string $class): ?ObjectManager
88
88
89
89
// todo cache/warmup an array of classes that are "doctrine objects"
90
90
foreach ($ this ->managerRegistries as $ registry ) {
91
-
92
91
// The doctrine registry does not resolve aliased interface
93
92
// if ($om = $registry->getManagerForClass($class)) {
94
93
// return self::ensureManagedObject($om, $class);
95
94
// }
96
-
97
95
foreach ($ registry ->getManagers () as $ om ) {
98
96
// But we can resolve nicely by trying to ask each manager to get the metadata
99
97
try {
100
- if ($ om ->getClassMetadata ($ class ) !== null ) {
98
+ if (null !== $ om ->getClassMetadata ($ class )) {
101
99
return self ::ensureManagedObject ($ om , $ class );
102
100
}
103
-
104
101
} catch (MappingException $ e ) {
105
102
// I did not find a nice way to check if it is because the class is really unknown
106
103
// It is good to check for a specific exception ?
107
104
// eg: \Doctrine\Persistence\Mapping\MappingException
108
105
// Maybe not needed, because it does not failed even when the class does not exist at all
109
- // throw $e;
106
+ // throw $e;
110
107
}
111
-
112
108
}
113
109
}
114
110
0 commit comments