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

Class: Squiz_Sniffs_CSS_ForbiddenStylesSniff

Source Location: /PHP_CodeSniffer-2.7.1/CodeSniffer/Standards/Squiz/Sniffs/CSS/ForbiddenStylesSniff.php

Class Overview


Squiz_Sniffs_CSS_ForbiddenStylesSniff.


Author(s):

Version:

  • Release: 2.7.1

Copyright:

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

Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 28]
Squiz_Sniffs_CSS_ForbiddenStylesSniff.

Bans the use of some styles, such as deprecated or browser-specific styles.



[ Top ]


Class Variables

$error =  true

[line 76]

If true, an error will be thrown; otherwise a warning.
  • Access: public

Type:   bool


[ Top ]

$forbiddenStyleNames = array()

[line 62]

A cache of forbidden style names, for faster lookups.
  • Access: protected

Type:   array(string)


[ Top ]

$forbiddenStyles = array(
                                  '-moz-border-radius'             => 'border-radius',
                                  '-webkit-border-radius'          => 'border-radius',
                                  '-moz-border-radius-topleft'     => 'border-top-left-radius',
                                  '-moz-border-radius-topright'    => 'border-top-right-radius',
                                  '-moz-border-radius-bottomright' => 'border-bottom-right-radius',
                                  '-moz-border-radius-bottomleft'  => 'border-bottom-left-radius',
                                  '-moz-box-shadow'                => 'box-shadow',
                                  '-webkit-box-shadow'             => 'box-shadow',
                                 )

[line 46]

A list of forbidden styles with their alternatives.

The value is NULL if no alternative exists. i.e., the function should just not be used.

  • Var: => string|null)
  • Access: protected

Type:   array(string


[ Top ]

$patternMatch =  false

[line 69]

If true, forbidden styles will be considered regular expressions.
  • Access: protected

Type:   bool


[ Top ]

$supportedTokenizers = array('CSS')

[line 36]

A list of tokenizers this sniff supports.
  • Access: public

Type:   array


[ Top ]



Method Detail

addError   [line 152]

void addError( PHP_CodeSniffer_File $phpcsFile, int $stackPtr, string $style, [string $pattern = null])

Generates the error or warning for this sniff.
  • Access: protected

Parameters:

PHP_CodeSniffer_File   $phpcsFile   —  The file being scanned.
int   $stackPtr   —  The position of the forbidden style in the token array.
string   $style   —  The name of the forbidden style.
string   $pattern   —  The pattern used for the match.

[ Top ]

process   [line 108]

void process( PHP_CodeSniffer_File $phpcsFile, int $stackPtr)

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

Parameters:

PHP_CodeSniffer_File   $phpcsFile   —  The file being scanned.
int   $stackPtr   —  The position of the current token in the stack passed in $tokens.

[ Top ]

register   [line 84]

array register( )

Returns an array of tokens this test wants to listen for.
  • Access: public

[ Top ]


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