File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -129,16 +129,13 @@ private function resolveNestedType(string $name): string
129129 ));
130130 }
131131
132- $ normalized = '[] ' === substr ($ name , -2 )
133- ? sprintf ('array<%s> ' , substr ($ name , 0 , -2 ))
134- : $ name ;
135-
136- if (0 === strpos ($ normalized , 'array< ' )) {
132+ $ altarray = '[] ' === substr ($ name , -2 );
133+ if ($ altarray || 0 === strpos ($ name , 'array< ' )) {
137134 return preg_replace_callback (
138135 '/^array<([^ ]*)>$/ ' ,
139- function ($ matches ) use ($ name ) {
140- $ resolved = $ this ->resolveNestedType ($ matches [1 ]);
141- return ( $ resolved === $ matches [ 1 ]) ? $ name : sprintf ('array<%s> ' , $ resolved );
136+ function ($ matches ) use ($ altarray ) {
137+ $ type = $ this ->resolveNestedType ($ matches [1 ]);
138+ return $ altarray ? $ type . ' [] ' : sprintf ('array<%s> ' , $ type );
142139 },
143140 $ name
144141 );
You can’t perform that action at this time.
0 commit comments