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

Class: ForbiddenStylesSniff

Source Location: /PHP_CodeSniffer-3.1.1/src/Standards/Squiz/Sniffs/CSS/ForbiddenStylesSniff.php

Class Overview


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


Author(s):

Copyright:

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

Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 15]
Bans the use of some styles, such as deprecated or browser-specific styles.


[ Top ]


Class Variables

$error =  true

[line 63]

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

Type:   boolean


[ Top ]

$forbiddenStyleNames = array()

[line 49]

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

Type:   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 33]

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


[ Top ]

$patternMatch =  false

[line 56]

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

Type:   boolean


[ Top ]

$supportedTokenizers = array('CSS')

[line 23]

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

Type:   array


[ Top ]



Method Detail

addError   [line 139]

void addError( \PHP_CodeSniffer\Files\File $phpcsFile, int $stackPtr, string $style, [string $pattern = null])

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

Parameters:

\PHP_CodeSniffer\Files\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 95]

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

array register( )

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

[ Top ]


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