File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -151,7 +151,7 @@ private function parsePhpDocForProperty(\ReflectionProperty $property): string
151151 if ($ result === 'unknown ' ) {
152152 if (preg_match ('/type="([a-zA-Z]+)"/i ' , $ docComment , $ matches )) {
153153 $ result = $ this ->getTypescriptProperty ($ matches [1 ]);
154- } elseif (preg_match ('/targetEntity="( [a-zA-Z- \\\\]+)" /i ' , $ docComment , $ matches )) {
154+ } elseif (preg_match ('/targetEntity=(" [a-zA-Z- \\\\]+")|([a-zA-Z]+::class) /i ' , $ docComment , $ matches )) {
155155 $ result = $ this ->getRelationCollectionProperty ($ docComment );
156156 }
157157 }
@@ -226,14 +226,15 @@ private function getRelationCollectionProperty(string $type): string
226226
227227 $ regex = array (
228228 '/targetEntity="([a-zA-Z]+)"/i ' ,
229+ '/targetEntity=([a-zA-Z]+)::class/i ' ,
229230 '/targetEntity="([a-zA-Z]+) \\\\([a-zA-Z]+) \\\\([a-zA-Z]+)"/i ' ,
230231 );
231232
232233 foreach ($ regex as $ reg ) {
233234 if (preg_match ($ reg , $ type , $ matches )) {
234235
235236 $ collection = '[] ' ;
236- if (strpos ($ type , 'OneToOne ' ) !== false ) {
237+ if (strpos ($ type , 'OneToOne ' ) !== false || strpos ( $ type , ' ManyToOne ' ) !== false ) {
237238 $ collection = '' ;
238239 }
239240
You can’t perform that action at this time.
0 commit comments