Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. FunctionDeclarationSniff.php

class FunctionDeclarationSniff

Same name in this branch
  1. 11.1.x vendor/drupal/coder/coder_sniffer/Drupal/Sniffs/Functions/FunctionDeclarationSniff.php \Drupal\Sniffs\Functions\FunctionDeclarationSniff
  2. 11.1.x vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Functions/FunctionDeclarationSniff.php \PHP_CodeSniffer\Standards\PEAR\Sniffs\Functions\FunctionDeclarationSniff

Hierarchy

  • class \PHP_CodeSniffer\Sniffs\AbstractPatternSniff implements \PHP_CodeSniffer\Sniffs\Sniff
    • class \PHP_CodeSniffer\Standards\Squiz\Sniffs\Functions\FunctionDeclarationSniff extends \PHP_CodeSniffer\Sniffs\AbstractPatternSniff

Expanded class hierarchy of FunctionDeclarationSniff

File

vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Functions/FunctionDeclarationSniff.php, line 14

Namespace

PHP_CodeSniffer\Standards\Squiz\Sniffs\Functions
View source
class FunctionDeclarationSniff extends AbstractPatternSniff {
    
    /**
     * Returns an array of patterns to check are correct.
     *
     * @return array
     */
    protected function getPatterns() {
        return [
            'function abc(...);',
            'function abc(...)',
            'abstract function abc(...);',
        ];
    }
    
    //end getPatterns()

}

Members

Title Sort descending Modifiers Object type Summary Overriden Title Overrides
AbstractPatternSniff::$currFile protected property The current file being checked.
AbstractPatternSniff::$errorPos private property Positions in the stack where errors have occurred.
AbstractPatternSniff::$ignoreComments public property If true, comments will be ignored if they are found in the code. 1
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.
FunctionDeclarationSniff::getPatterns protected function Returns an array of patterns to check are correct. Overrides AbstractPatternSniff::getPatterns
RSS feed
Powered by Drupal