@@ -90,7 +90,7 @@ public function generateDefinition(string $class, array $properties) : void
90
90
91
91
if (isset ($ details ['$ref ' ]))
92
92
{
93
- $ type = $ this ->getTypeNameFromRef ($ details ['$ref ' ]);
93
+ $ docType = $ type = $ this ->getTypeNameFromRef ($ details ['$ref ' ]);
94
94
}
95
95
else
96
96
{
@@ -109,7 +109,7 @@ public function generateDefinition(string $class, array $properties) : void
109
109
$ type = $ details ['format ' ];
110
110
}
111
111
112
- $ type = $ this ->getPHPType ($ type );
112
+ $ docType = $ type = $ this ->getPHPType ($ type );
113
113
114
114
if (isset ($ details ['enum ' ]))
115
115
{
@@ -133,6 +133,7 @@ public function generateDefinition(string $class, array $properties) : void
133
133
134
134
if ('array ' == $ type && $ itemType )
135
135
{
136
+ $ docType = 'array< ' . $ itemType . '> ' ;
136
137
$ type = 'array[ ' . $ itemType . '] ' ;
137
138
138
139
if ($ details ['maxItems ' ] ?? false )
@@ -164,7 +165,7 @@ public function generateDefinition(string $class, array $properties) : void
164
165
$ type = $ originalType ;
165
166
}
166
167
$ type = \str_replace ('\\\\' , '\\' , $ type );
167
- $ docBlock [] = "{$ type } {$ dollar }{$ name } {$ description }" ;
168
+ $ docBlock [] = "{$ docType } {$ dollar }{$ name } {$ description }" ;
168
169
}
169
170
}
170
171
$ this ->generateFromTemplate ($ class , ['fields ' => $ fields , 'minLength ' => $ minLength , 'maxLength ' => $ maxLength , ], $ docBlock );
0 commit comments