File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed
Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change 55namespace TypeLang \PhpDocParser \DocBlock \Tag ;
66
77use TypeLang \Parser \Node \Stmt \TypeStatement ;
8+ use TypeLang \Printer \PrettyPrinter ;
89
910abstract class TypedTag extends Tag implements TypeProviderInterface
1011{
@@ -29,11 +30,19 @@ public function getType(): TypeStatement
2930 */
3031 public function __toString (): string
3132 {
33+ $ type = $ this ->type ::class;
34+
35+ if (\property_exists ($ this ->type , 'name ' )) {
36+ $ type = (string )$ this ->type ->name ;
37+ }
38+
39+ if (\class_exists (PrettyPrinter::class)) {
40+ $ type = (new PrettyPrinter ())->print ($ this ->type );
41+ }
42+
3243 return \rtrim (\vsprintf ('@%s %s %s ' , [
3344 $ this ->name ,
34- \property_exists ($ this ->type , 'name ' )
35- ? (string )$ this ->type ->name
36- : $ this ->type ::class,
45+ $ type ,
3746 (string )$ this ->description ,
3847 ]));
3948 }
You can’t perform that action at this time.
0 commit comments