Skip to content

Commit

Permalink
Merge branch 'master' into stellr
Browse files Browse the repository at this point in the history
  • Loading branch information
pprkut committed Apr 24, 2024
2 parents 6164fed + 90db017 commit 269847a
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions Stellr/Sniffs/Commenting/ClassCommentSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ class ClassCommentSniff implements Sniff
'@implements' => false,
];

private $phpstan_tags = [
'@phpstan-type' => false,
'@phpstan-import-type' => false,
];

/**
* Returns an array of tokens this test wants to listen for.
*
Expand Down Expand Up @@ -138,6 +143,7 @@ public function process(File $phpcsFile, $stackPtr)
$phpunit_tag_keys = array_keys($this->phpunit_tags);
$magic_tag_keys = array_keys($this->magic_tags);
$generics_tag_keys = array_keys($this->generics_tags);
$phpstan_tag_keys = array_keys($this->phpstan_tags);

$handled = [];

Expand Down Expand Up @@ -165,6 +171,11 @@ public function process(File $phpcsFile, $stackPtr)
$handled[] = $name;
continue;
}
elseif (in_array($name, $phpstan_tag_keys))
{
$handled[] = $name;
continue;
}

$error = '%s tag is not allowed in class comment';
$data = array($tokens[$tag]['content']);
Expand Down

0 comments on commit 269847a

Please sign in to comment.