apidoc
[ class tree: apidoc ] [ index: apidoc ] [ all elements ]

Class: UselessOverridingMethodSniff

Source Location: /PHP_CodeSniffer-3.1.1/src/Standards/Generic/Sniffs/CodeAnalysis/UselessOverridingMethodSniff.php

Class Overview


Detects unnecessary overridden methods that simply call their parent.


Author(s):

Copyright:

  • 2007-2014 Manuel Pichler. All rights reserved.

Methods


Inherited Variables

Inherited Methods


Class Details

[line 28]
Detects unnecessary overridden methods that simply call their parent.

This rule is based on the PMD rule catalog. The Useless Overriding Method sniff detects the use of methods that only call their parent classes's method with the same name and arguments. These methods are not required.

  1.  class FooBar {
  2.    public function __construct($a$b{
  3.      parent::__construct($a$b);
  4.    }
  5.  }



[ Top ]


Method Detail

process   [line 53]

void process( File $phpcsFile, int $stackPtr)

Processes this test, when one of its tokens is encountered.
  • Access: public

Parameters:

\PHP_CodeSniffer\Files\File   $phpcsFile   —  The file being scanned.
int   $stackPtr   —  The position of the current token in the stack passed in $tokens.

[ Top ]

register   [line 37]

int[] register( )

Registers the tokens that this sniff wants to listen for.
  • Access: public

[ Top ]


Documentation generated on Mon, 11 Mar 2019 15:27:51 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.