You are here

OperatorSpacingSniff.php in Coder 7.2

Same filename and directory in other branches
  1. 8.2 coder_sniffer/Drupal/Sniffs/WhiteSpace/OperatorSpacingSniff.php

File

coder_sniffer/Drupal/Sniffs/WhiteSpace/OperatorSpacingSniff.php
View source
<?php

/**
 * Drupal_Sniffs_WhiteSpace_OperatorSpacingSniff.
 *
 * PHP version 5
 *
 * @category PHP
 * @package  PHP_CodeSniffer
 * @link     http://pear.php.net/package/PHP_CodeSniffer
 */

/**
 * Overrides Squiz_Sniffs_WhiteSpace_OperatorSpacingSniff to not check inline if/then
 * statements because those are handled by
 * Drupal_Sniffs_Formatting_SpaceInlineIfSniff.
 *
 * @category PHP
 * @package  PHP_CodeSniffer
 * @link     http://pear.php.net/package/PHP_CodeSniffer
 */
class Drupal_Sniffs_WhiteSpace_OperatorSpacingSniff extends Squiz_Sniffs_WhiteSpace_OperatorSpacingSniff {

  /**
   * Returns an array of tokens this test wants to listen for.
   *
   * @return array
   */
  public function register() {
    $comparison = PHP_CodeSniffer_Tokens::$comparisonTokens;
    $operators = PHP_CodeSniffer_Tokens::$operators;
    $assignment = PHP_CodeSniffer_Tokens::$assignmentTokens;
    return array_unique(array_merge($comparison, $operators, $assignment));
  }

}

//end class

Classes

Namesort descending Description
Drupal_Sniffs_WhiteSpace_OperatorSpacingSniff Overrides Squiz_Sniffs_WhiteSpace_OperatorSpacingSniff to not check inline if/then statements because those are handled by Drupal_Sniffs_Formatting_SpaceInlineIfSniff.