@@ -290,6 +290,19 @@ private function createProperty(
290
290
} elseif (isset ($ varTags [$ propertyName ])) {
291
291
$ phpDocType = $ varTags [$ propertyName ]->getType ();
292
292
}
293
+
294
+ if (!isset ($ phpDocBlockClassReflection )) {
295
+ throw new ShouldNotHappenException ();
296
+ }
297
+
298
+ $ phpDocType = $ phpDocType !== null ? TemplateTypeHelper::resolveTemplateTypes (
299
+ $ phpDocType ,
300
+ $ phpDocBlockClassReflection ->getActiveTemplateTypeMap (),
301
+ ) : null ;
302
+ $ deprecatedDescription = $ resolvedPhpDoc ->getDeprecatedTag () !== null ? $ resolvedPhpDoc ->getDeprecatedTag ()->getMessage () : null ;
303
+ $ isDeprecated = $ resolvedPhpDoc ->isDeprecated ();
304
+ $ isInternal = $ resolvedPhpDoc ->isInternal ();
305
+ $ isReadOnlyByPhpDoc = $ isReadOnlyByPhpDoc || $ resolvedPhpDoc ->isReadOnly ();
293
306
}
294
307
295
308
if ($ phpDocType === null ) {
@@ -315,20 +328,6 @@ private function createProperty(
315
328
}
316
329
}
317
330
318
- if ($ resolvedPhpDoc !== null ) {
319
- if (!isset ($ phpDocBlockClassReflection )) {
320
- throw new ShouldNotHappenException ();
321
- }
322
- $ phpDocType = $ phpDocType !== null ? TemplateTypeHelper::resolveTemplateTypes (
323
- $ phpDocType ,
324
- $ phpDocBlockClassReflection ->getActiveTemplateTypeMap (),
325
- ) : null ;
326
- $ deprecatedDescription = $ resolvedPhpDoc ->getDeprecatedTag () !== null ? $ resolvedPhpDoc ->getDeprecatedTag ()->getMessage () : null ;
327
- $ isDeprecated = $ resolvedPhpDoc ->isDeprecated ();
328
- $ isInternal = $ resolvedPhpDoc ->isInternal ();
329
- $ isReadOnlyByPhpDoc = $ isReadOnlyByPhpDoc || $ resolvedPhpDoc ->isReadOnly ();
330
- }
331
-
332
331
if (
333
332
$ phpDocType === null
334
333
&& $ this ->inferPrivatePropertyTypeFromConstructor
0 commit comments