Source Location: /PHP_CodeSniffer-0.1.0/CodeSniffer/Standards/AbstractPatternSniff.php
[line 46]
Processes pattern strings and checks that the code conforms to the pattern.
This test essentially checks that code is correctly formatted with whitespace.
- Author: Squiz Pty Ltd
- Abstract:
__construct (Constructor) [line 85]
PHP_CodeSniffer_Standards_AbstractPatternSniff __construct(
[boolean
$ignoreComments = false])
Constructs a PHP_CodeSniffer_Standards_AbstractPatternSniff.
Overridden in child classes as:
- PEAR_Sniffs_ControlStructures_ControlSignatureSniff::__construct()
- Constructs a PEAR_Sniffs_ControlStructures_ControlSignatureSniff.
Parameters:
boolean
$ignoreComments
—
If true, comments will be ignored.
getPatterns [line 451]
prepareError [line 432]
string prepareError(
string
$found, string
$patternCode)
Prepares an error for the specified patternCode.
- Return: the error message.
- Access: protected
Parameters:
string
$found
—
The actual found string in the code.
string
$patternCode
—
The expected pattern code.
process [line 203]
Processes the test.
Parameters:
int
$stackPtr
—
The postion in the tokens stack where the listening token type was found.
processPattern [line 256]
Processes the pattern and varifies the code at $stackPtr.
Parameters:
array
$patternInfo
—
The info for the pattern to process.
int
$stackPtr
—
The postion in the tokens stack where the listening token type was found.
processSupplementary [line 481]
Processes any tokens registered with registerSupplementary().
Parameters:
int
$stackPtr
—
The position in the tokens stack to process.
register [line 102]
Registers the tokens to listen to.
Classes extending AbstractPatternTest should implement the getPatterns() method to register the patterns they wish to test.
registerSupplementary [line 464]
array(int) registerSupplementary(
)
Registers any supplementary tokens that this test might wish to process.
A sniff may wish to register supplementary tests when it wishes to group an arbitary validation that cannot be performed using a pattern, with other pattern tests.