Skip to content

Commit

Permalink
PHP 8.0 | Generic/UpperCaseConstantName: allow for nullsafe object op…
Browse files Browse the repository at this point in the history
…erator

Includes unit test.
  • Loading branch information
jrfnl committed Sep 1, 2020
1 parent 85f3521 commit 8a17a80
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ public function process(File $phpcsFile, $stackPtr)
$prev = $phpcsFile->findPrevious(T_WHITESPACE, ($stackPtr - 1), null, true);
if ($tokens[$prev]['code'] === T_OBJECT_OPERATOR
|| $tokens[$prev]['code'] === T_DOUBLE_COLON
|| $tokens[$prev]['code'] === T_NULLSAFE_OBJECT_OPERATOR
) {
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,5 @@ class ClassConstBowOutTest {
const // phpcs:ignore Standard.Category.Sniff
some_constant = 2;
}

$foo->getBar()?->define('foo');

0 comments on commit 8a17a80

Please sign in to comment.