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

Breadcrumb

  1. Drupal Core 11.1.x

MethodDeclarationSniff.php

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

Namespace

Drupal\Sniffs\Methods

File

vendor/drupal/coder/coder_sniffer/Drupal/Sniffs/Methods/MethodDeclarationSniff.php

View source
<?php


/**
 * \Drupal\Sniffs\Methods\MethodDeclarationSniff.
 *
 * @category PHP
 * @package  PHP_CodeSniffer
 * @link     http://pear.php.net/package/PHP_CodeSniffer
 */
namespace Drupal\Sniffs\Methods;

use PHP_CodeSniffer\Sniffs\AbstractScopeSniff;
use PHP_CodeSniffer\Standards\PSR2\Sniffs\Methods\MethodDeclarationSniff as PSR2MethodDeclarationSniff;

/**
 * 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
 */
class MethodDeclarationSniff extends PSR2MethodDeclarationSniff {
    
    /**
     * Constructor.
     */
    public function __construct() {
        AbstractScopeSniff::__construct([
            T_CLASS,
            T_INTERFACE,
            T_TRAIT,
            T_ENUM,
        ], [
            T_FUNCTION,
        ]);
    }
    
    //end __construct()

}

//end class

Classes

Title Deprecated Summary
MethodDeclarationSniff Checks that the method declaration is correct.

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal