Skip to content

Commit 8f396ac

Browse files
Sander van der Vlugtsvandervlugt
authored andcommitted
Add support for classes in the global namespace, like DateTime
1 parent ae44129 commit 8f396ac

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

src/Reflection/ReflectionClass.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ public function getProperties(): array
311311
// would not be parsed.
312312
//
313313
// Skip T_STRING and "?" because if it exists, it must be a type declaration.
314-
$var_loc = $tokens->next($vis_loc, [T_COMMENT, T_WHITESPACE, T_STATIC, T_FINAL, T_STRING, '?']);
314+
$var_loc = $tokens->next($vis_loc, [T_COMMENT, T_WHITESPACE, T_STATIC, T_FINAL, T_STRING, '?', T_NAME_FULLY_QUALIFIED]);
315315
if ($tokens->type($var_loc) !== T_VARIABLE) {
316316
continue;
317317
}

test/Generator/fixtures/Annotations.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@ class Annotations
1212
* @AG\Generate(type="\DateTime")
1313
* @Stupid\Really
1414
*/
15-
public $stupid;
15+
public ?\DateTime $stupid;
1616
}

0 commit comments

Comments
 (0)