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

Class: UnconditionalIfStatementSniff

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

Class Overview


Detects unconditional if- and elseif-statements.


Author(s):

Copyright:

  • 2007-2014 Manuel Pichler. All rights reserved.

Methods


Inherited Variables

Inherited Methods


Class Details

[line 33]
Detects unconditional if- and elseif-statements.

This rule is based on the PMD rule catalog. The Unconditional If Statement sniff detects statement conditions that are only set to one of the constant values true or false

  1.  class Foo
  2.  {
  3.      public function close()
  4.      {
  5.          if (true)
  6.          {
  7.              // ...
  8.          }
  9.      }
  10.  }



[ Top ]


Method Detail

process   [line 61]

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 42]

int[] register( )

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

[ Top ]


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