Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. NamespaceDeclarationSniff.php

function NamespaceDeclarationSniff::process

Same name in this branch
  1. 11.1.x vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Namespaces/NamespaceDeclarationSniff.php \PHP_CodeSniffer\Standards\PSR2\Sniffs\Namespaces\NamespaceDeclarationSniff::process()

* @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint *

Parameters

int $namespacePointer:

Overrides Sniff::process

File

vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Namespaces/NamespaceDeclarationSniff.php, line 38

Class

NamespaceDeclarationSniff

Namespace

SlevomatCodingStandard\Sniffs\Namespaces

Code

public function process(File $phpcsFile, $namespacePointer) : void {
    $tokens = $phpcsFile->getTokens();
    $pointerAfterNamespace = TokenHelper::findNextEffective($phpcsFile, $namespacePointer + 1);
    if ($tokens[$pointerAfterNamespace]['code'] === T_NS_SEPARATOR) {
        return;
    }
    $this->checkWhitespaceAfterNamespace($phpcsFile, $namespacePointer);
    $this->checkDisallowedContentBetweenNamespaceNameAndSemicolon($phpcsFile, $namespacePointer);
    $this->checkDisallowedBracketedSyntax($phpcsFile, $namespacePointer);
}
RSS feed
Powered by Drupal