EmbeddedPhpSniff
in package
implements
Sniff
Table of Contents
Interfaces
Methods
- process() : void
- Processes this test, when one of its tokens is encountered.
- register() : array<string|int, int|string>
- Returns an array of tokens this test wants to listen for.
- reportEmptyTagSet() : void
- Report and fix an set of empty PHP tags.
- validateInlineEmbeddedPhp() : void
- Validates embedded PHP that exists on one line.
- validateMultilineEmbeddedPhp() : void
- Validates embedded PHP that exists on multiple lines.
Methods
process()
Processes this test, 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.
register()
Returns an array of tokens this test wants to listen for.
public
register() : array<string|int, int|string>
Return values
array<string|int, int|string>reportEmptyTagSet()
Report and fix an set of empty PHP tags.
private
reportEmptyTagSet(File $phpcsFile, int $stackPtr, int $closeTag) : void
Parameters
- $phpcsFile : File
-
The file being scanned.
- $stackPtr : int
-
The position of the current token in the stack passed in $tokens.
- $closeTag : int
-
The position of the PHP close tag in the stack passed in $tokens.
validateInlineEmbeddedPhp()
Validates embedded PHP that exists on one line.
private
validateInlineEmbeddedPhp(File $phpcsFile, int $stackPtr, int $closeTag) : void
Parameters
- $phpcsFile : File
-
The file being scanned.
- $stackPtr : int
-
The position of the current token in the stack passed in $tokens.
- $closeTag : int
-
The position of the PHP close tag in the stack passed in $tokens.
validateMultilineEmbeddedPhp()
Validates embedded PHP that exists on multiple lines.
private
validateMultilineEmbeddedPhp(File $phpcsFile, int $stackPtr, int|false $closingTag) : void
Parameters
- $phpcsFile : File
-
The file being scanned.
- $stackPtr : int
-
The position of the current token in the stack passed in $tokens.
- $closingTag : int|false
-
The position of the PHP close tag in the stack passed in $tokens.