FileList
in package
implements
Iterator, Countable
Table of Contents
Interfaces
- Iterator
- Countable
Properties
- $config : Config
- The config data for the run.
- $ruleset : Ruleset
- The ruleset used for the run.
- $ignorePatterns : array<string|int, mixed>
- An array of patterns to use for skipping files.
- $files : array<string|int, mixed>
- A list of file paths that are included in the list.
- $numFiles : int
- The number of files in the list.
Methods
- __construct() : void
- Constructs a file list and loads in an array of file paths to process.
- addFile() : void
- Add a file to the list.
- count() : int
- Return the number of files in the list.
- current() : File
- Get the file that is currently being processed.
- key() : string|null
- Return the file path of the current file being processed.
- next() : void
- Move forward to the next file.
- rewind() : void
- Rewind the iterator to the first file.
- valid() : bool
- Checks if current position is valid.
- getFilterClass() : string
- Get the class name of the filter being used for the run.
Properties
$config
The config data for the run.
public
Config
$config
= null
$ruleset
The ruleset used for the run.
public
Ruleset
$ruleset
= null
$ignorePatterns
An array of patterns to use for skipping files.
protected
array<string|int, mixed>
$ignorePatterns
= []
$files
A list of file paths that are included in the list.
private
array<string|int, mixed>
$files
= []
$numFiles
The number of files in the list.
private
int
$numFiles
= 0
Methods
__construct()
Constructs a file list and loads in an array of file paths to process.
public
__construct(Config $config, Ruleset $ruleset) : void
Parameters
addFile()
Add a file to the list.
public
addFile(string $path[, File $file = null ]) : void
If a file object has already been created, it can be passed here. If it is left NULL, it will be created when accessed.
Parameters
- $path : string
-
The path to the file being added.
- $file : File = null
-
The file being added.
count()
Return the number of files in the list.
public
count() : int
Attributes
Return values
intcurrent()
Get the file that is currently being processed.
public
current() : File
Attributes
Return values
Filekey()
Return the file path of the current file being processed.
public
key() : string|null
Attributes
Return values
string|null —Path name or null
when the end of the iterator has been reached.
next()
Move forward to the next file.
public
next() : void
Attributes
rewind()
Rewind the iterator to the first file.
public
rewind() : void
Attributes
valid()
Checks if current position is valid.
public
valid() : bool
Attributes
Return values
boolgetFilterClass()
Get the class name of the filter being used for the run.
private
getFilterClass() : string