HumHub Documentation (unofficial)

ReservedFunctionNamesSniff extends Generic_Sniffs_NamingConventions_CamelCapsFunctionNameSniff
in package

All function and method names starting with double underscore are reserved by PHP.

PHP version All

Tags
link
https://www.php.net/manual/en/language.oop5.magic.php
since
8.2.0

This was previously, since 7.0.3, checked by the upstream sniff.

since
9.3.2

The sniff will now ignore functions marked as @deprecated by design.

Table of Contents

Methods

__construct()  : mixed
Overload the constructor to work round various PHPCS cross-version compatibility issues.
processTokenOutsideScope()  : void
Processes the tokens outside the scope.
processTokenWithinScope()  : void
Processes the tokens within the scope.
isFunctionDeprecated()  : bool
Check whether a function has been marked as deprecated via a @deprecated tag in the function docblock.

Methods

__construct()

Overload the constructor to work round various PHPCS cross-version compatibility issues.

public __construct() : mixed
Tags
since
8.2.0

processTokenOutsideScope()

Processes the tokens outside the scope.

protected processTokenOutsideScope(PHP_CodeSniffer_File $phpcsFile, int $stackPtr) : void
Parameters
$phpcsFile : PHP_CodeSniffer_File

The file being processed.

$stackPtr : int

The position where this token was found.

Tags
since
8.2.0

processTokenWithinScope()

Processes the tokens within the scope.

protected processTokenWithinScope(PHP_CodeSniffer_File $phpcsFile, int $stackPtr, int $currScope) : void
Parameters
$phpcsFile : PHP_CodeSniffer_File

The file being processed.

$stackPtr : int

The position where this token was found.

$currScope : int

The position of the current scope.

Tags
since
8.2.0

isFunctionDeprecated()

Check whether a function has been marked as deprecated via a @deprecated tag in the function docblock.

private isFunctionDeprecated(File $phpcsFile, int $stackPtr) : bool
Parameters
$phpcsFile : File

The file being scanned.

$stackPtr : int

The position of a T_FUNCTION token in the stack.

Tags
since
9.3.2
Return values
bool

        
On this page

Search results