Documentation

FilterOptions
in package

Parse, validate and match --grep, --insensitive and --invert command options.

Table of Contents

$filter  : mixed
$insensitive  : mixed
$invert  : mixed
$pattern  : mixed
bind()  : mixed
Bind input and prepare filter.
getOptions()  : array<string|int, InputOption>
Get input option definitions for filtering.
hasFilter()  : bool
Check whether the bound input has filter options.
match()  : bool
Check whether a string matches the current filter options.
stringIsRegex()  : bool
Check whether a string appears to be a regular expression.
validateInput()  : bool
Validate that grep, invert and insensitive input options are consistent.
validateRegex()  : bool
Validate that $pattern is a valid regular expression.

Properties

Methods

hasFilter()

Check whether the bound input has filter options.

public hasFilter() : bool
Return values
bool

match()

Check whether a string matches the current filter options.

public match(string $string[, array<string|int, mixed> &$matches = null ]) : bool
Parameters
$string : string
$matches : array<string|int, mixed> = null
Return values
bool

stringIsRegex()

Check whether a string appears to be a regular expression.

private stringIsRegex(string $string) : bool
Parameters
$string : string
Return values
bool

validateInput()

Validate that grep, invert and insensitive input options are consistent.

private validateInput(InputInterface $input) : bool
Parameters
$input : InputInterface
Return values
bool

validateRegex()

Validate that $pattern is a valid regular expression.

private validateRegex(string $pattern) : bool
Parameters
$pattern : string
Return values
bool

Search results