@@ -16,12 +16,15 @@ class ExportedClassConstantNode implements ExportedNode, JsonSerializable
16
16
17
17
private bool $ private ;
18
18
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 )
20
22
{
21
23
$ this ->name = $ name ;
22
24
$ this ->value = $ value ;
23
25
$ this ->public = $ public ;
24
26
$ this ->private = $ private ;
27
+ $ this ->phpDoc = $ phpDoc ;
25
28
}
26
29
27
30
public function equals (ExportedNode $ node ): bool
@@ -30,6 +33,18 @@ public function equals(ExportedNode $node): bool
30
33
return false ;
31
34
}
32
35
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
+
33
48
return $ this ->name === $ node ->name
34
49
&& $ this ->value === $ node ->value
35
50
&& $ this ->public === $ node ->public
@@ -46,7 +61,8 @@ public static function __set_state(array $properties): ExportedNode
46
61
$ properties ['name ' ],
47
62
$ properties ['value ' ],
48
63
$ properties ['public ' ],
49
- $ properties ['private ' ]
64
+ $ properties ['private ' ],
65
+ $ properties ['phpDoc ' ]
50
66
);
51
67
}
52
68
@@ -60,7 +76,8 @@ public static function decode(array $data): ExportedNode
60
76
$ data ['name ' ],
61
77
$ data ['value ' ],
62
78
$ data ['public ' ],
63
- $ data ['private ' ]
79
+ $ data ['private ' ],
80
+ $ data ['phpDoc ' ],
64
81
);
65
82
}
66
83
@@ -76,6 +93,7 @@ public function jsonSerialize()
76
93
'value ' => $ this ->value ,
77
94
'public ' => $ this ->public ,
78
95
'private ' => $ this ->private ,
96
+ 'phpDoc ' => $ this ->phpDoc ,
79
97
],
80
98
];
81
99
}
0 commit comments