@@ -16,12 +16,15 @@ class ExportedClassConstantNode implements ExportedNode, JsonSerializable
1616
1717 private bool $ private ;
1818
19- public function __construct (string $ name , string $ value , bool $ public , bool $ private )
19+ private ?ExportedPhpDocNode $ phpDoc ;
20+
21+ public function __construct (string $ name , string $ value , bool $ public , bool $ private , ?ExportedPhpDocNode $ phpDoc )
2022 {
2123 $ this ->name = $ name ;
2224 $ this ->value = $ value ;
2325 $ this ->public = $ public ;
2426 $ this ->private = $ private ;
27+ $ this ->phpDoc = $ phpDoc ;
2528 }
2629
2730 public function equals (ExportedNode $ node ): bool
@@ -30,6 +33,18 @@ public function equals(ExportedNode $node): bool
3033 return false ;
3134 }
3235
36+ if ($ this ->phpDoc === null ) {
37+ if ($ node ->phpDoc !== null ) {
38+ return false ;
39+ }
40+ } elseif ($ node ->phpDoc !== null ) {
41+ if (!$ this ->phpDoc ->equals ($ node ->phpDoc )) {
42+ return false ;
43+ }
44+ } else {
45+ return false ;
46+ }
47+
3348 return $ this ->name === $ node ->name
3449 && $ this ->value === $ node ->value
3550 && $ this ->public === $ node ->public
@@ -46,7 +61,8 @@ public static function __set_state(array $properties): ExportedNode
4661 $ properties ['name ' ],
4762 $ properties ['value ' ],
4863 $ properties ['public ' ],
49- $ properties ['private ' ]
64+ $ properties ['private ' ],
65+ $ properties ['phpDoc ' ]
5066 );
5167 }
5268
@@ -60,7 +76,8 @@ public static function decode(array $data): ExportedNode
6076 $ data ['name ' ],
6177 $ data ['value ' ],
6278 $ data ['public ' ],
63- $ data ['private ' ]
79+ $ data ['private ' ],
80+ $ data ['phpDoc ' ],
6481 );
6582 }
6683
@@ -76,6 +93,7 @@ public function jsonSerialize()
7693 'value ' => $ this ->value ,
7794 'public ' => $ this ->public ,
7895 'private ' => $ this ->private ,
96+ 'phpDoc ' => $ this ->phpDoc ,
7997 ],
8098 ];
8199 }
0 commit comments