File tree Expand file tree Collapse file tree 2 files changed +16
-6
lines changed
Expand file tree Collapse file tree 2 files changed +16
-6
lines changed Original file line number Diff line number Diff line change @@ -46,13 +46,9 @@ public function getDescription(): Description|null
4646 */
4747 public function __toString (): string
4848 {
49- if ($ this ->description === null ) {
50- return \sprintf ('@%s ' , $ this ->name );
51- }
52-
53- return \vsprintf ('@%s %s ' , [
49+ return \rtrim (\vsprintf ('@%s %s ' , [
5450 $ this ->name ,
5551 (string )$ this ->description ,
56- ]);
52+ ])) ;
5753 }
5854}
Original file line number Diff line number Diff line change @@ -23,4 +23,18 @@ public function getType(): TypeStatement
2323 {
2424 return $ this ->type ;
2525 }
26+
27+ /**
28+ * @psalm-immutable
29+ */
30+ public function __toString (): string
31+ {
32+ return \rtrim (\vsprintf ('@%s %s %s ' , [
33+ $ this ->name ,
34+ \property_exists ($ this ->type , 'name ' )
35+ ? (string )$ this ->type ->name
36+ : $ this ->type ::class,
37+ (string )$ this ->description ,
38+ ]));
39+ }
2640}
You can’t perform that action at this time.
0 commit comments