Skip to content

Commit e92957e

Browse files
committed
Modernize: Squiz/PostStatementComment: use class constant for constant array
1 parent 92599f5 commit e92957e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Standards/Squiz/Sniffs/Commenting/PostStatementCommentSniff.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ class PostStatementCommentSniff implements Sniff
2121
* If post statement comments are found within the condition
2222
* parenthesis of these structures, leave them alone.
2323
*
24-
* @var array
24+
* @var array<int|string, true>
2525
*/
26-
private $controlStructureExceptions = [
26+
private const CONTROL_STRUCTURE_EXCEPTIONS = [
2727
T_IF => true,
2828
T_ELSEIF => true,
2929
T_SWITCH => true,
@@ -92,7 +92,7 @@ public function process(File $phpcsFile, $stackPtr)
9292
$nestedParens = $tokens[$stackPtr]['nested_parenthesis'];
9393
foreach ($nestedParens as $open => $close) {
9494
if (isset($tokens[$open]['parenthesis_owner']) === true
95-
&& isset($this->controlStructureExceptions[$tokens[$tokens[$open]['parenthesis_owner']]['code']]) === true
95+
&& isset(self::CONTROL_STRUCTURE_EXCEPTIONS[$tokens[$tokens[$open]['parenthesis_owner']]['code']]) === true
9696
) {
9797
return;
9898
}

0 commit comments

Comments
 (0)