Skip to content

Commit

Permalink
Do not warn about repetetive numeric strings
Browse files Browse the repository at this point in the history
  • Loading branch information
OskarStark committed Oct 10, 2019
1 parent c30ac27 commit c6c5bfc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Rule/AvoidRepetetiveWords.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public function check(\ArrayIterator $lines, int $number)
continue;
}

if (isset($words[$key + 1]) && !empty($words[$key + 1]) && 1 < \strlen($word) && $words[$key + 1] == $word) {
if (isset($words[$key + 1]) && !empty($words[$key + 1]) && 1 < \strlen($word) && $words[$key + 1] == $word && !is_numeric($word)) {
return sprintf('The word "%s" is used more times in a row.', $word);
}
}
Expand Down
5 changes: 5 additions & 0 deletions tests/Rule/AvoidRepetetiveWordsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,5 +119,10 @@ public function checkProvider()
' services : ~',
], 2),
];

yield 'numeric repetition' => [
null,
new RstSample('This is valid 123 123'),
];
}
}

0 comments on commit c6c5bfc

Please sign in to comment.