Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/TodoByIssueUrlRule.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,12 @@ public function processNode(Node $node, Scope $scope): array
continue;
}

// Adding a space after the {url} allows to have a proper clickable link, without the
// additional character at the end being part of the link's URL, which breaks GitHub links.
if ('' !== $todoText) {
$errorMessage = "Should have been resolved in {$url}: ". rtrim($todoText, '.') .'.';
$errorMessage = "Should have been resolved in {$url} : ". rtrim($todoText, '.') .'.';
} else {
$errorMessage = "Comment should have been resolved with {$url}.";
$errorMessage = "Comment should have been resolved with {$url} .";
}

$errors[] = $this->errorBuilder->buildError(
Expand Down
4 changes: 2 additions & 2 deletions tests/TodoByIssueUrlRuleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ public static function provideErrors(): iterable
yield [
[
[
'Should have been resolved in https://github.com/staabm/phpstan-todo-by/issues/47: we need todo something when this issue is resolved.',
'Should have been resolved in https://github.com/staabm/phpstan-todo-by/issues/47 : we need todo something when this issue is resolved.',
5,
],
[
'Comment should have been resolved with https://github.com/staabm/phpstan-todo-by/pull/155.',
'Comment should have been resolved with https://github.com/staabm/phpstan-todo-by/pull/155 .',
6,
],
],
Expand Down