Skip to content

Commit 855ed03

Browse files
committed
Tokenizer: support hash comment for ignore annotations
Until now, for the PHPCS native ignore annotations, only `//` slash or `/* */` star-style comments were supported. This adds support for PHPCS native ignore annotations using `#` hash-style comments.
1 parent d33a6a9 commit 855ed03

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Tokenizers/Tokenizer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ private function createPositionMap()
250250
|| $this->tokens[$i]['code'] === T_DOC_COMMENT_TAG
251251
|| ($inTests === true && $this->tokens[$i]['code'] === T_INLINE_HTML)
252252
) {
253-
$commentText = ltrim($this->tokens[$i]['content'], " \t/*");
253+
$commentText = ltrim($this->tokens[$i]['content'], " \t/*#");
254254
$commentText = rtrim($commentText, " */\t\r\n");
255255
$commentTextLower = strtolower($commentText);
256256
if (strpos($commentText, '@codingStandards') !== false) {

0 commit comments

Comments
 (0)