PSR2_Sniffs_Classes_ClassDeclarationSniff
extends PEAR_Sniffs_Classes_ClassDeclarationSniff
in package
Class Declaration Test.
Checks the declaration of the class and its inheritance is correct.
Tags
Table of Contents
- $indent : int
- The number of spaces code should be indented.
- process() : void
- Processes this test, when one of its tokens is encountered.
- processClose() : void
- Processes the closing section of a class declaration.
- processOpen() : void
- Processes the opening section of a class declaration.
- register() : array<string|int, mixed>
- Returns an array of tokens this test wants to listen for.
Properties
$indent
The number of spaces code should be indented.
public
int
$indent
= 4
Methods
process()
Processes this test, when one of its tokens is encountered.
public
process(PHP_CodeSniffer_File $phpcsFile, int $stackPtr) : void
Parameters
- $phpcsFile : PHP_CodeSniffer_File
-
The file being scanned.
- $stackPtr : int
-
The position of the current token in the stack passed in $tokens.
Return values
void —processClose()
Processes the closing section of a class declaration.
public
processClose(PHP_CodeSniffer_File $phpcsFile, int $stackPtr) : void
Parameters
- $phpcsFile : PHP_CodeSniffer_File
-
The file being scanned.
- $stackPtr : int
-
The position of the current token in the stack passed in $tokens.
Return values
void —processOpen()
Processes the opening section of a class declaration.
public
processOpen(PHP_CodeSniffer_File $phpcsFile, int $stackPtr) : void
Parameters
- $phpcsFile : PHP_CodeSniffer_File
-
The file being scanned.
- $stackPtr : int
-
The position of the current token in the stack passed in $tokens.
Return values
void —register()
Returns an array of tokens this test wants to listen for.
public
register() : array<string|int, mixed>