@@ -108,7 +108,7 @@ public function provide(Operation $operation, array $uriVariables = [], array $c
108
108
if ($ exception ->canUseMessageForUser ()) {
109
109
$ parameters ['hint ' ] = $ exception ->getMessage ();
110
110
}
111
- $ violations ->add (new ConstraintViolation ($ this ->translator ->trans ($ message , ['{{ type }} ' => implode ('| ' , $ expectedTypes ?? [] )], 'validators ' ), $ message , $ parameters , null , $ exception ->getPath (), null , null , (string ) Type::INVALID_TYPE_ERROR ));
111
+ $ violations ->add (new ConstraintViolation ($ this ->translator ->trans ($ message , ['{{ type }} ' => implode ('| ' , $ expectedTypes )], 'validators ' ), $ message , $ parameters , null , $ exception ->getPath (), null , null , (string ) Type::INVALID_TYPE_ERROR ));
112
112
}
113
113
if (0 !== \count ($ violations )) {
114
114
throw new ValidationException ($ violations );
@@ -125,14 +125,14 @@ private function normalizeExpectedTypes(?array $expectedTypes = null): array
125
125
foreach ($ expectedTypes ?? [] as $ expectedType ) {
126
126
$ normalizedType = $ expectedType ;
127
127
128
- if (( \ class_exists ($ expectedType ) || \ interface_exists ($ expectedType) )) {
128
+ if (class_exists ($ expectedType ) || interface_exists ($ expectedType )) {
129
129
try {
130
130
$ normalizedType = $ this ->resourceMetadataCollectionFactory ->create ($ expectedType )->getOperation ()->getShortName ();
131
131
} catch (\Throwable ) {
132
132
// Do nothing
133
133
}
134
134
135
- if ($ normalizedType === null ) {
135
+ if (null === $ normalizedType ) {
136
136
$ classReflection = new \ReflectionClass ($ expectedType );
137
137
$ normalizedType = $ classReflection ->getShortName ();
138
138
}
@@ -141,7 +141,6 @@ private function normalizeExpectedTypes(?array $expectedTypes = null): array
141
141
$ normalizedTypes [] = $ normalizedType ;
142
142
}
143
143
144
-
145
144
return $ normalizedTypes ;
146
145
}
147
146
}
0 commit comments