LowerCaseTypeSniff
in package
implements
Sniff
Interfaces, Classes and Traits
Table of Contents
- $phpTypes : array<string|int, mixed>
- Native types supported by PHP.
- process() : void
- Processes this sniff, when one of its tokens is encountered.
- register() : array<string|int, mixed>
- Returns an array of tokens this test wants to listen for.
- processType() : void
- Processes a type cast or a singular type declaration.
- processUnionType() : void
- Processes a union type declaration.
Properties
$phpTypes
Native types supported by PHP.
private
array<string|int, mixed>
$phpTypes
= ['self' => true, 'parent' => true, 'array' => true, 'callable' => true, 'bool' => true, 'float' => true, 'int' => true, 'string' => true, 'iterable' => true, 'void' => true, 'object' => true, 'mixed' => true, 'static' => true, 'false' => true, 'null' => true]
Methods
process()
Processes this sniff, when one of its tokens is encountered.
public
process(File $phpcsFile, int $stackPtr) : void
Parameters
- $phpcsFile : 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>
Return values
array<string|int, mixed> —processType()
Processes a type cast or a singular type declaration.
protected
processType(File $phpcsFile, int $stackPtr, string $type, string $error, string $errorCode) : void
Parameters
- $phpcsFile : File
-
The file being scanned.
- $stackPtr : int
-
The position of the type token.
- $type : string
-
The type found.
- $error : string
-
Error message template.
- $errorCode : string
-
The error code.
Return values
void —processUnionType()
Processes a union type declaration.
protected
processUnionType(File $phpcsFile, int $typeDeclStart, int $typeDeclEnd, string $error, string $errorCode) : void
Parameters
- $phpcsFile : File
-
The file being scanned.
- $typeDeclStart : int
-
The position of the start of the type token.
- $typeDeclEnd : int
-
The position of the end of the type token.
- $error : string
-
Error message template.
- $errorCode : string
-
The error code.