Skip to content

Commit

Permalink
Tokenizer: support hash comment for ignore annotations
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jrfnl committed Aug 31, 2020
1 parent d33a6a9 commit 855ed03
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Tokenizers/Tokenizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ private function createPositionMap()
|| $this->tokens[$i]['code'] === T_DOC_COMMENT_TAG
|| ($inTests === true && $this->tokens[$i]['code'] === T_INLINE_HTML)
) {
$commentText = ltrim($this->tokens[$i]['content'], " \t/*");
$commentText = ltrim($this->tokens[$i]['content'], " \t/*#");
$commentText = rtrim($commentText, " */\t\r\n");
$commentTextLower = strtolower($commentText);
if (strpos($commentText, '@codingStandards') !== false) {
Expand Down

0 comments on commit 855ed03

Please sign in to comment.