File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed
lib/Doctrine/ODM/MongoDB/Types Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -171,18 +171,18 @@ public static function getTypeFromPHPVariable($variable): ?Type
171
171
}
172
172
173
173
// Try the variable class as type name
174
- try {
174
+ if ( self :: hasType ( $ variable ::class)) {
175
175
return self ::getType ($ variable ::class);
176
- } catch (InvalidTypeException ) {
177
- return null ;
178
176
}
177
+
178
+ return null ;
179
179
}
180
180
181
181
return match (gettype ($ variable )) {
182
- 'integer ' => self ::getType (' int ' ),
183
- 'boolean ' => self ::getType (' bool ' ),
184
- 'double ' => self ::getType (' float ' ),
185
- 'string ' => self ::getType (' string ' ),
182
+ 'integer ' => self ::getType (self :: INT ),
183
+ 'boolean ' => self ::getType (self :: BOOL ),
184
+ 'double ' => self ::getType (self :: FLOAT ),
185
+ 'string ' => self ::getType (self :: STRING ),
186
186
default => null ,
187
187
};
188
188
}
You can’t perform that action at this time.
0 commit comments