File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed
tests/Integration/TestCase Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change 2424use function array_filter ;
2525use function array_map ;
2626use function count ;
27+ use function explode ;
2728use function gettype ;
2829use function is_object ;
30+ use function preg_replace ;
2931use function sprintf ;
32+ use function str_contains ;
3033use function ucfirst ;
3134
3235/**
@@ -261,18 +264,16 @@ private static function getDtoProperties(): array
261264 private static function getType (string $ class , string $ property ): string
262265 {
263266 $ propertyInfo = self ::initializePropertyExtractor ();
264- $ types = $ propertyInfo ->getTypes ($ class , $ property );
265267
266- self ::assertNotNull ($ types );
268+ $ type = $ propertyInfo ->getType ($ class , $ property );
269+ $ type = preg_replace ('/^array<.*>$/ ' , 'array ' , (string )$ type );
267270
268- $ type = $ types [ 0 ]-> getBuiltinType ( );
271+ self :: assertNotNull ( $ type );
269272
270- if ($ type === ' object ' ) {
271- $ type = $ types [ 0 ]-> getClassName () ;
273+ if (str_contains ( $ type, ' | ' ) ) {
274+ $ type = explode ( ' | ' , $ type )[ 1 ] ;
272275 }
273276
274- self ::assertNotNull ($ type );
275-
276277 return $ type ;
277278 }
278279}
You can’t perform that action at this time.
0 commit comments