Skip to content

Commit

Permalink
SlevomatCodingStandard.Commenting.InlineDocCommentDeclaration: Fixed …
Browse files Browse the repository at this point in the history
…false positive for final constant
  • Loading branch information
kukulich committed Sep 4, 2023
1 parent fd2b381 commit 789275d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
use const T_CONST;
use const T_DOC_COMMENT_OPEN_TAG;
use const T_EQUAL;
use const T_FINAL;
use const T_FN;
use const T_FOREACH;
use const T_LIST;
Expand Down Expand Up @@ -89,7 +90,7 @@ public function process(File $phpcsFile, $commentOpenPointer): void

if (in_array(
$tokens[$pointerAfterCommentClosePointer]['code'],
[T_PRIVATE, T_PROTECTED, T_PUBLIC, T_READONLY, T_CONST],
[T_PRIVATE, T_PROTECTED, T_PUBLIC, T_READONLY, T_FINAL, T_CONST],
true
)) {
return;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php // lint >= 8.1
<?php // lint >= 8.2

/**
* @var string
Expand Down Expand Up @@ -33,6 +33,14 @@ class Foo
/** @var string */
static $static;

/**
* @var list<MyEnum> For PHPStorm
*/
final public const ENUM_LIST = [
MyEnum::One,
MyEnum::Two,
];

public function __construct()
{
/** @var string[] $a */
Expand Down

0 comments on commit 789275d

Please sign in to comment.