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

Class: Squiz_Sniffs_Operators_ComparisonOperatorUsageSniff

Source Location: /PHP_CodeSniffer-0.7.0/CodeSniffer/Standards/Squiz/Sniffs/Operators/ComparisonOperatorUsageSniff.php

Class Overview


A Sniff to enforce the use of IDENTICAL type operators rather than EQUAL operators.


Author(s):

Version:

  • Release: 0.7.0

Copyright:

  • 2006 Squiz Pty Ltd (ABN 77 084 670 600)

Methods


Inherited Variables

Inherited Methods


Class Details

[line 52]
A Sniff to enforce the use of IDENTICAL type operators rather than EQUAL operators.

The use of === true is enforced over implicit true statements, for example:

  1.  if ($a)
  2.  {
  3.      ...
  4.  }

should be:

  1.  if ($a === true)
  2.  {
  3.      ...
  4.  }

It also enforces the use of === false over ! operators.



[ Top ]


Method Detail

process   [line 106]

void process( PHP_CodeSniffer_File $phpcsFile, int $stackPtr)

Process the tokens that this sniff is listening for.
  • Access: public

Parameters:

PHP_CodeSniffer_File   $phpcsFile   —  The file where the token was found.
int   $stackPtr   —  The position in the stack where the token was found.

[ Top ]

register   [line 87]

array register( )

Registers the token types that this sniff wishes to listen to.
  • Access: public

[ Top ]


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