class ControlSignatureSniff
Same name in this branch
- 11.1.x vendor/drupal/coder/coder_sniffer/Drupal/Sniffs/ControlStructures/ControlSignatureSniff.php \Drupal\Sniffs\ControlStructures\ControlSignatureSniff
- 11.1.x vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/ControlStructures/ControlSignatureSniff.php \PHP_CodeSniffer\Standards\Squiz\Sniffs\ControlStructures\ControlSignatureSniff
Hierarchy
- class \PHP_CodeSniffer\Sniffs\AbstractPatternSniff implements \PHP_CodeSniffer\Sniffs\Sniff
- class \PHP_CodeSniffer\Standards\PEAR\Sniffs\ControlStructures\ControlSignatureSniff extends \PHP_CodeSniffer\Sniffs\AbstractPatternSniff
Expanded class hierarchy of ControlSignatureSniff
File
-
vendor/
squizlabs/ php_codesniffer/ src/ Standards/ PEAR/ Sniffs/ ControlStructures/ ControlSignatureSniff.php, line 14
Namespace
PHP_CodeSniffer\Standards\PEAR\Sniffs\ControlStructuresView source
class ControlSignatureSniff extends AbstractPatternSniff {
/**
* If true, comments will be ignored if they are found in the code.
*
* @var boolean
*/
public $ignoreComments = true;
/**
* Returns the patterns that this test wishes to verify.
*
* @return string[]
*/
protected function getPatterns() {
return [
'do {EOL...} while (...);EOL',
'while (...) {EOL',
'for (...) {EOL',
'if (...) {EOL',
'foreach (...) {EOL',
'} else if (...) {EOL',
'} elseif (...) {EOL',
'} else {EOL',
'do {EOL',
'match (...) {EOL',
];
}
//end getPatterns()
}
Members
Title Sort descending | Modifiers | Object type | Summary | Overriden Title |
---|---|---|---|---|
AbstractPatternSniff::$currFile | protected | property | The current file being checked. | |
AbstractPatternSniff::$errorPos | private | property | Positions in the stack where errors have occurred. | |
AbstractPatternSniff::$parsedPatterns | private | property | The parsed patterns array. | |
AbstractPatternSniff::$supplementaryTokens | private | property | Tokens that this sniff wishes to process outside of the patterns. | |
AbstractPatternSniff::createSkipPattern | private | function | Creates a skip pattern. | |
AbstractPatternSniff::createTokenPattern | private | function | Creates a token pattern. | |
AbstractPatternSniff::getListenerTokenPos | private | function | Returns the position in the pattern that this test should register as a listener for the pattern. |
|
AbstractPatternSniff::getPatternTokenTypes | private | function | Returns the token types that the specified pattern is checking for. | |
AbstractPatternSniff::parse | private | function | Parses a pattern string into an array of pattern steps. | |
AbstractPatternSniff::prepareError | protected | function | Prepares an error for the specified patternCode. | |
AbstractPatternSniff::process | final public | function | Processes the test. | Overrides Sniff::process |
AbstractPatternSniff::processPattern | protected | function | Processes the pattern and verifies the code at $stackPtr. | |
AbstractPatternSniff::processSupplementary | protected | function | Processes any tokens registered with registerSupplementary(). | |
AbstractPatternSniff::register | final public | function | Registers the tokens to listen to. | Overrides Sniff::register |
AbstractPatternSniff::registerSupplementary | protected | function | Registers any supplementary tokens that this test might wish to process. | |
AbstractPatternSniff::__construct | public | function | Constructs a AbstractPatternSniff. | |
ControlSignatureSniff::$ignoreComments | public | property | If true, comments will be ignored if they are found in the code. | Overrides AbstractPatternSniff::$ignoreComments |
ControlSignatureSniff::getPatterns | protected | function | Returns the patterns that this test wishes to verify. | Overrides AbstractPatternSniff::getPatterns |