\Composer\Package\ArchiverBaseExcludeFilter

Summary

Methods
Properties
Constants
__construct()
filter()
No public properties found
No constants found
parseLines()
generatePatterns()
generatePattern()
$sourcePath
$excludePatterns
N/A
No private methods found
No private properties found
N/A

Properties

$sourcePath

$sourcePath : string

Type

string

$excludePatterns

$excludePatterns : array

Type

array

Methods

__construct()

__construct(string  $sourcePath) 

Parameters

string $sourcePath

Directory containing sources to be filtered

filter()

filter(string  $relativePath, boolean  $exclude) : boolean

Checks the given path against all exclude patterns in this filter

Negated patterns overwrite exclude decisions of previous filters.

Parameters

string $relativePath

The file's path relative to the sourcePath

boolean $exclude

Whether a previous filter wants to exclude this file

Returns

boolean —

Whether the file should be excluded

parseLines()

parseLines(array  $lines, callable  $lineParser) : array

Processes a file containing exclude rules of different formats per line

Parameters

array $lines

A set of lines to be parsed

callable $lineParser

The parser to be used on each line

Returns

array —

Exclude patterns to be used in filter()

generatePatterns()

generatePatterns(array  $rules) : array

Generates a set of exclude patterns for filter() from gitignore rules

Parameters

array $rules

A list of exclude rules in gitignore syntax

Returns

array —

Exclude patterns

generatePattern()

generatePattern(string  $rule) : array

Generates an exclude pattern for filter() from a gitignore rule

Parameters

string $rule

An exclude rule in gitignore syntax

Returns

array —

An exclude pattern