Method | Description | |
---|---|---|
process ( PHP_CodeSniffer_File $phpcsFile, integer $stackPtr ) : void | Processes this test, when one of its tokens is encountered. | |
register ( ) : array | Returns an array of tokens this test wants to listen for. |
Method | Description | |
---|---|---|
addChangeset ( PHP_CodeSniffer_File $phpcsFile, array $tokens, integer $open_tag_pointer, integer $close_tag_pointer, boolean $echo = false ) : void | Add a changeset to replace the alternative PHP tags. | |
findClosingTag ( PHP_CodeSniffer_File $phpcsFile, array $tokens, integer $stackPtr, string $content ) : integer | false | Try and find a matching PHP closing tag. | |
getSnippet ( string $content, string $start_at = '', integer $length = 40 ) : string | Get a snippet from a HTML token. |
protected addChangeset ( PHP_CodeSniffer_File $phpcsFile, array $tokens, integer $open_tag_pointer, integer $close_tag_pointer, boolean $echo = false ) : void | ||
$phpcsFile | PHP_CodeSniffer_File | The file being scanned. |
$tokens | array | The token stack. |
$open_tag_pointer | integer | Stack pointer to the PHP open tag. |
$close_tag_pointer | integer | Stack pointer to the PHP close tag. |
$echo | boolean | Whether to add 'echo' or not. |
return | void |
protected findClosingTag ( PHP_CodeSniffer_File $phpcsFile, array $tokens, integer $stackPtr, string $content ) : integer | false | ||
$phpcsFile | PHP_CodeSniffer_File | The file being scanned. |
$tokens | array | The token stack. |
$stackPtr | integer | The position of the current token in the stack passed in $tokens. |
$content | string | The expected content of the closing tag to match the opener. |
return | integer | false | Pointer to the position in the stack for the closing tag or false if not found. |
protected getSnippet ( string $content, string $start_at = '', integer $length = 40 ) : string | ||
$content | string | The content of the HTML token. |
$start_at | string | Partial string to use as a starting point for the snippet. |
$length | integer | The target length of the snippet to get. Defaults to 40. |
return | string |