Skip to content

Commit

Permalink
Merge branch 'php-8.0/squiz-lowercasephpfunctions-support-nullsafe-op…
Browse files Browse the repository at this point in the history
  • Loading branch information
gsherwood committed Sep 2, 2020
2 parents e22262c + a222ec6 commit 5ddc6fe
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,9 @@ public function process(File $phpcsFile, $stackPtr)
return;
}

if ($tokens[$prev]['code'] === T_OBJECT_OPERATOR) {
if ($tokens[$prev]['code'] === T_OBJECT_OPERATOR
|| $tokens[$prev]['code'] === T_NULLSAFE_OBJECT_OPERATOR
) {
// Not an inbuilt function.
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,5 @@ $callToNamespacedFunction = MyNamespace /* phpcs:ignore Standard */ \STR_REPEAT(
$callToNamespacedFunction = namespace\STR_REPEAT($a, 2); // Could potentially be false negative.

$filePath = new \File($path);

$count = $object?->Count();
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,5 @@ $callToNamespacedFunction = MyNamespace /* phpcs:ignore Standard */ \STR_REPEAT(
$callToNamespacedFunction = namespace\STR_REPEAT($a, 2); // Could potentially be false negative.

$filePath = new \File($path);

$count = $object?->Count();

0 comments on commit 5ddc6fe

Please sign in to comment.