From bf46cc506d8d925ce16307ad0884844dfd7c65b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Gro=C3=9Fklaus?= Date: Fri, 17 Jun 2022 11:29:59 +0200 Subject: [PATCH] Make sure error messages end with a . This is necessary because the twigcs vscode extension has a regex that checks for error messages ending with a dot --- src/WithOnlyRule.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/WithOnlyRule.php b/src/WithOnlyRule.php index 6a0e71c..9a4931a 100644 --- a/src/WithOnlyRule.php +++ b/src/WithOnlyRule.php @@ -62,7 +62,7 @@ public function validateWithUsedWithOnly(Token $token, TokenStream &$tokens): ar if (Token::WHITESPACE_TYPE === $tokens->look(Lexer::NEXT_TOKEN)->getType()) { if (Token::NAME_TYPE === $tokens->look(2)->getType()) { if (Token::WHITESPACE_TYPE === $tokens->look(3)->getType() && $tokens->look(4)->getValue() !== 'only') { - $violations[] = $this->createViolation($tokens->getSourceContext()->getPath(), $token->getLine(), '0', '"with" should be used along with "only"'); + $violations[] = $this->createViolation($tokens->getSourceContext()->getPath(), $token->getLine(), '0', '"with" should be used along with "only".'); } } // If it starts "with" and is "{" count till matching "}" @@ -83,7 +83,7 @@ public function validateWithUsedWithOnly(Token $token, TokenStream &$tokens): ar } } if (!($tokens->look($look_ahead_position)->getValue() == 'only' || $tokens->look($look_ahead_position + 1)->getValue() == 'only')) { - $violations[] = $this->createViolation($tokens->getSourceContext()->getPath(), $token->getLine(), '0', '"with" should be used along with "only"'); + $violations[] = $this->createViolation($tokens->getSourceContext()->getPath(), $token->getLine(), '0', '"with" should be used along with "only".'); } } }