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

Breadcrumb

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

function DisallowNamedArgumentsSniff::process

* @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint *

Parameters

int $argumentNamePointer:

Overrides Sniff::process

File

vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Functions/DisallowNamedArgumentsSniff.php, line 29

Class

DisallowNamedArgumentsSniff

Namespace

SlevomatCodingStandard\Sniffs\Functions

Code

public function process(File $phpcsFile, $argumentNamePointer) : void {
    $tokens = $phpcsFile->getTokens();
    $phpcsFile->addError(sprintf('Named arguments are disallowed, usage of named argument "%s" found.', $tokens[$argumentNamePointer]['content']), $argumentNamePointer, self::CODE_DISALLOWED_NAMED_ARGUMENT);
}
RSS feed
Powered by Drupal