Skip to content

Commit 2597096

Browse files
committed
Fix comparing constant PHPDocs
1 parent cfffeac commit 2597096

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

extractor/extract.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -664,7 +664,15 @@ private function stmtDiff(Node $old, Node $new, string $updateTo): array
664664
*/
665665
private function compareConstants(Node\Stmt\ClassConst $old, Node\Stmt\ClassConst $new, string $updateTo): array
666666
{
667-
if ($old->getDocComment() !== $new->getDocComment()) {
667+
if ($old->getDocComment() !== null) {
668+
if ($new->getDocComment() === null) {
669+
return $this->stmtDiff($old, $new, $updateTo);
670+
}
671+
672+
if ($old->getDocComment()->getText() !== $new->getDocComment()->getText()) {
673+
return $this->stmtDiff($old, $new, $updateTo);
674+
}
675+
} elseif ($new->getDocComment() !== null) {
668676
return $this->stmtDiff($old, $new, $updateTo);
669677
}
670678
if ($old->flags !== $new->flags) {

0 commit comments

Comments
 (0)