@@ -32,8 +32,8 @@ public function testVarTagIsResolvedByImportsOfClassFile(): void
3232 $ metadata = self ::readPhpDoc (DocBlockStub::class);
3333
3434 $ accounts = self ::getProperty ($ metadata , 'accounts ' );
35- self ::assertType ('list< ' . UserStub::class . '> ' , $ accounts ->read ?->type);
36- self ::assertType ('list< ' . UserStub::class . '> ' , $ accounts ->write ?->type);
35+ self ::assertType ('list< \\ ' . UserStub::class . '> ' , $ accounts ->read ?->type);
36+ self ::assertType ('list< \\ ' . UserStub::class . '> ' , $ accounts ->write ?->type);
3737 self ::assertSame ('DocBlockStub.php ' , \basename ((string ) $ accounts ->read ?->type?->source->file ));
3838 }
3939
@@ -42,16 +42,16 @@ public function testNamesWithoutImportAreKeptAsWritten(): void
4242 $ metadata = self ::readPhpDoc (DocBlockStub::class);
4343
4444 self ::assertType ('T ' , self ::getProperty ($ metadata , 'template ' )->read ?->type);
45- self ::assertType (DocBlockStub::class . '<T>|null ' , self ::getProperty ($ metadata , 'self ' )->read ?->type);
45+ self ::assertType ('\\' . DocBlockStub::class . '<T>|null ' , self ::getProperty ($ metadata , 'self ' )->read ?->type);
4646 }
4747
4848 public function testSelfIsDeclaringClassAndStaticIsReadClass (): void
4949 {
5050 $ metadata = self ::readPhpDoc (SelfChildStub::class);
5151
52- self ::assertType (SelfBaseStub::class . '|null ' , self ::getProperty ($ metadata , 'self ' )->read ?->type);
53- self ::assertType (SelfChildStub::class . '|null ' , self ::getProperty ($ metadata , 'static ' )->read ?->type);
54- self ::assertType (SelfBaseStub::class . '|null ' , self ::getProperty ($ metadata , 'parent ' )->read ?->type);
52+ self ::assertType ('\\' . SelfBaseStub::class . '|null ' , self ::getProperty ($ metadata , 'self ' )->read ?->type);
53+ self ::assertType ('\\' . SelfChildStub::class . '|null ' , self ::getProperty ($ metadata , 'static ' )->read ?->type);
54+ self ::assertType ('\\' . SelfBaseStub::class . '|null ' , self ::getProperty ($ metadata , 'parent ' )->read ?->type);
5555 }
5656
5757 public function testParentOfClassWithoutParentIsErrorOfType (): void
@@ -70,7 +70,7 @@ public function testClassOfNamespaceOfDeclarationIsResolvedWithoutImport(): void
7070 {
7171 $ metadata = self ::readPhpDoc (PromotedStub::class);
7272
73- self ::assertType ('list< ' . UserStub::class . '> ' , self ::getProperty ($ metadata , 'users ' )->write ?->type);
73+ self ::assertType ('list< \\ ' . UserStub::class . '> ' , self ::getProperty ($ metadata , 'users ' )->write ?->type);
7474 }
7575
7676 public function testTagUnknownToParserIsIgnoredAndTagOfOtherVariableIsSkipped (): void
@@ -111,7 +111,7 @@ public function testPromotedPropertyIsReadFromVarThenFromConstructorParam(): voi
111111 {
112112 $ metadata = self ::readPhpDoc (PromotedStub::class);
113113
114- self ::assertType ('list< ' . UserStub::class . '> ' , self ::getProperty ($ metadata , 'users ' )->write ?->type);
114+ self ::assertType ('list< \\ ' . UserStub::class . '> ' , self ::getProperty ($ metadata , 'users ' )->write ?->type);
115115 self ::assertType ('positive-int ' , self ::getProperty ($ metadata , 'count ' )->read ?->type);
116116 self ::assertType ('TItem ' , self ::getProperty ($ metadata , 'item ' )->read ?->type);
117117 self ::assertType ('string ' , self ::getProperty ($ metadata , 'required ' )->read ?->type);
@@ -131,7 +131,7 @@ public function testTraitPropertyIsResolvedByImportsOfTraitFile(): void
131131 {
132132 $ type = self ::getProperty (self ::readPhpDoc (TraitUserStub::class), 'owners ' )->read ?->type;
133133
134- self ::assertType ('list< ' . UserStub::class . '> ' , $ type );
134+ self ::assertType ('list< \\ ' . UserStub::class . '> ' , $ type );
135135 self ::assertSame ('OwnerTrait.php ' , \basename ((string ) $ type ->source ->file ));
136136 }
137137
0 commit comments