Skip to content

Commit

Permalink
Add new PhpSc rule: NativeFunctionInvocation.
Browse files Browse the repository at this point in the history
- Bug fix
  • Loading branch information
stkec committed Mar 19, 2022
1 parent 8eda466 commit e072b2b
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ private function formatForForbidden(array $functionNames): array
*/
protected function addError($phpcsFile, $stackPtr, $functionName, $pattern = null)
{
$prevToken = $phpcsFile->findPrevious(T_WHITESPACE, ($stackPtr - 1), null, true);
if ($phpcsFile->getTokens()[$prevToken]['code'] === T_NS_SEPARATOR) {
return;
}

$phpcsFile->addError($this->getErrorMessage(), $stackPtr, 'Encountered', [$functionName, $functionName]);
}

Expand Down

0 comments on commit e072b2b

Please sign in to comment.