opt
/
cpanel
/
ea-wappspector
/
vendor
/
slevomat
/
coding-standard
/
SlevomatCodingStandard
/
Sniffs
/
Functions
➕ New
📤 Upload
✎ Editing:
DisallowNamedArgumentsSniff.php
← Back
<?php declare(strict_types = 1); namespace SlevomatCodingStandard\Sniffs\Functions; use PHP_CodeSniffer\Files\File; use PHP_CodeSniffer\Sniffs\Sniff; use function sprintf; use const T_PARAM_NAME; class DisallowNamedArgumentsSniff implements Sniff { public const CODE_DISALLOWED_NAMED_ARGUMENT = 'DisallowedNamedArgument'; /** * @return array<int, (int|string)> */ public function register(): array { return [ T_PARAM_NAME, ]; } /** * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint * @param int $argumentNamePointer */ 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, ); } }
💾 Save Changes
Cancel
📤 Upload File
×
Select File
Upload
Cancel
➕ Create New
×
Type
📄 File
📁 Folder
Name
Create
Cancel
✎ Rename Item
×
Current Name
New Name
Rename
Cancel
🔐 Change Permissions
×
Target File
Permission (e.g., 0755, 0644)
0755
0644
0777
Apply
Cancel