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

Class: Filter

Source Location: /PHP_CodeSniffer-3.1.1/src/Filters/Filter.php

Class Overview

\
   |
   --Filter

A base filter class for filtering out files and folders during a run.


Author(s):

Copyright:

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

Variables

Methods


Child classes:

ExactMatch
An abstract filter class for checking files and folders against exact matches.

Inherited Variables

Inherited Methods


Class Details

[line 16]
A base filter class for filtering out files and folders during a run.


[ Top ]


Class Variables

$basedir =  null

[line 23]

The top-level path we are filtering.
  • Access: protected

Type:   string


[ Top ]

$config =  null

[line 30]

The config data for the run.
  • Access: protected

Type:   \PHP_CodeSniffer\Config


[ Top ]

$ignoreDirPatterns =  null

[line 44]

A list of ignore patterns that apply to directories only.
  • Access: protected

Type:   array


[ Top ]

$ignoreFilePatterns =  null

[line 51]

A list of ignore patterns that apply to files only.
  • Access: protected

Type:   array


[ Top ]

$ruleset =  null

[line 37]

The ruleset used for the run.
  • Access: protected

Type:   \PHP_CodeSniffer\Ruleset


[ Top ]



Method Detail

__construct (Constructor)   [line 64]

void __construct( \RecursiveIterator $iterator, string $basedir, Config $config, Ruleset $ruleset)

Constructs a filter.
  • Access: public

Parameters:

\RecursiveIterator   $iterator   —  The iterator we are using to get file paths.
string   $basedir   —  The top-level path we are filtering.
\PHP_CodeSniffer\Config   $config   —  The config data for the run.
\PHP_CodeSniffer\Ruleset   $ruleset   —  The ruleset used for the run.

[ Top ]

accept   [line 82]

bool accept( )

Check whether the current element of the iterator is acceptable.

Files are checked for allowed extensions and ignore patterns. Directories are checked for ignore patterns only.

  • Access: public

Overridden in child classes as:

ExactMatch::accept()
Check whether the current element of the iterator is acceptable.

[ Top ]

getChildren   [line 114]

\RecursiveIterator getChildren( )

Returns an iterator for the current entry.

Ensures that the ignore patterns are preserved so they don't have to be generated each time.

  • Access: public

Overridden in child classes as:

ExactMatch::getChildren()
Returns an iterator for the current entry.

[ Top ]

shouldIgnorePath   [line 177]

bool shouldIgnorePath( string $path)

Checks filtering rules to see if a path should be ignored.
  • Access: protected

Parameters:

string   $path   —  The path to the file or directory being checked.

[ Top ]

shouldProcessFile   [line 140]

bool shouldProcessFile( string $path)

Checks filtering rules to see if a file should be checked.

Checks both file extension filters and path ignore filters.

  • Access: protected

Parameters:

string   $path   —  The path to the file being checked.

[ Top ]


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