diff --git a/src/TodoByRule.php b/src/TodoByRule.php index e2ab29f..cb09f4f 100644 --- a/src/TodoByRule.php +++ b/src/TodoByRule.php @@ -87,13 +87,13 @@ public function processNode(Node $node, Scope $scope): array continue; } - // Have always present date at the start of the message. - $errorMessage = "Expired on {$date}"; + // Have always present date at the start of the message. // If there is further text, append it. if ($todoText !== '') { - - $errorMessage .= ": {$todoText}"; + $errorMessage = "Expired on {$date}: {$todoText}"; + } else { + $errorMessage = "Comment expired on {$date}"; } $wholeMatchStartOffset = $match[0][1]; diff --git a/tests/TodoByRuleTest.php b/tests/TodoByRuleTest.php index 196cefe..a556ec8 100644 --- a/tests/TodoByRuleTest.php +++ b/tests/TodoByRuleTest.php @@ -44,7 +44,7 @@ public function testRule(): void 19, ], [ - 'Expired on 2023-12-14', + 'Comment expired on 2023-12-14', 21, ], [