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

Breadcrumb

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

class MethodDeclarationSniff

Same name in this branch
  1. 11.1.x vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Methods/MethodDeclarationSniff.php \PHP_CodeSniffer\Standards\PSR2\Sniffs\Methods\MethodDeclarationSniff

Checks that the method declaration is correct.

Extending \PHP_CodeSniffer\Standards\PSR2\Sniffs\Methods\MethodDeclarationSniff to also support traits.

@category PHP @package PHP_CodeSniffer @link http://pear.php.net/package/PHP_CodeSniffer

Hierarchy

  • class \PHP_CodeSniffer\Sniffs\AbstractScopeSniff implements \PHP_CodeSniffer\Sniffs\Sniff
    • class \PHP_CodeSniffer\Standards\PSR2\Sniffs\Methods\MethodDeclarationSniff extends \PHP_CodeSniffer\Sniffs\AbstractScopeSniff
      • class \Drupal\Sniffs\Methods\MethodDeclarationSniff extends \PHP_CodeSniffer\Standards\PSR2\Sniffs\Methods\MethodDeclarationSniff

Expanded class hierarchy of MethodDeclarationSniff

File

vendor/drupal/coder/coder_sniffer/Drupal/Sniffs/Methods/MethodDeclarationSniff.php, line 26

Namespace

Drupal\Sniffs\Methods
View source
class MethodDeclarationSniff extends PSR2MethodDeclarationSniff {
    
    /**
     * Constructor.
     */
    public function __construct() {
        AbstractScopeSniff::__construct([
            T_CLASS,
            T_INTERFACE,
            T_TRAIT,
            T_ENUM,
        ], [
            T_FUNCTION,
        ]);
    }
    
    //end __construct()

}

Members

Title Sort descending Modifiers Object type Summary Overriden Title
AbstractScopeSniff::$listenOutside private property True if this test should fire on tokens outside of the scope.
AbstractScopeSniff::$scopeTokens private property The type of scope opener tokens that this test wishes to listen to.
AbstractScopeSniff::$tokens private property The token types that this test wishes to listen to within the scope.
AbstractScopeSniff::process final public function Processes the tokens that this test is listening for. Overrides Sniff::process
AbstractScopeSniff::register final public function The method that is called to register the tokens this test wishes to
listen to.
Overrides Sniff::register
MethodDeclarationSniff::processTokenOutsideScope protected function Processes a token that is found within the scope that this test is
listening to.
Overrides AbstractScopeSniff::processTokenOutsideScope
MethodDeclarationSniff::processTokenWithinScope protected function Processes the function tokens within the class. Overrides AbstractScopeSniff::processTokenWithinScope
MethodDeclarationSniff::__construct public function Constructor. Overrides MethodDeclarationSniff::__construct
RSS feed
Powered by Drupal