Composer API
Class

Composer\Package\Archiver\HgExcludeFilter

class HgExcludeFilter extends BaseExcludeFilter

An exclude filter that processes hgignore files

Constants

HG_IGNORE_REGEX

HG_IGNORE_GLOB

Methods

__construct(string $sourcePath)

Parses .hgignore file if it exist

bool filter(string $relativePath, bool $exclude)

Checks the given path against all exclude patterns in this filter

from BaseExcludeFilter
array parseHgIgnoreLine(string $line)

Callback line parser which process hgignore lines

array patternFromRegex(string $line)

Generates an exclude pattern for filter() from a hg regexp expression

Details

at line 38
public __construct(string $sourcePath)

Parses .hgignore file if it exist

Parameters

string $sourcePath Directory containing sources to be filtered

in BaseExcludeFilter at line 51
public bool filter(string $relativePath, bool $exclude)

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
bool $exclude Whether a previous filter wants to exclude this file

Return Value

bool Whether the file should be excluded

at line 59
public array parseHgIgnoreLine(string $line)

Callback line parser which process hgignore lines

Parameters

string $line A line from .hgignore

Return Value

array An exclude pattern for filter()

at line 100
public array patternFromRegex(string $line)

Generates an exclude pattern for filter() from a hg regexp expression

Parameters

string $line A line from .hgignore in regexp mode

Return Value

array An exclude pattern for filter()