Documentation

FileFilter

Class FileFilter

Tags
author

MacFJA

license

MIT

Table of Contents

Properties

$attempts  : mixed
$default  : mixed
$normalizer  : mixed
$question  : mixed
$validator  : mixed
$wrappedMethodHistory  : mixed

Methods

__call()  : $this
Magic function to wrapper some Symfony Finder method
__construct()  : mixed
Constructor.
changed()  : $this
date()  : $this
directories()  : $this
dots()  : $this
filter()  : $this
followSymlinks()  : $this
getDefault()  : mixed
Returns the default answer.
getMaxAttempts()  : null|int
Gets the maximum number of attempts.
getNormalizer()  : string|Closure
Gets the normalizer for the response.
getQuestion()  : string
Returns the question.
getResultFor()  : array<string|int, mixed>
Get the list of directory and files that match the current partial path (or its parent directory)
getValidator()  : null|callable
Gets the validator for the question.
modified()  : $this
owner()  : $this
setMaxAttempts()  : $this
Sets the maximum number of attempts.
setNormalizer()  : $this
Sets a normalizer for the response.
setValidator()  : $this
Sets a validator for the question.
size()  : $this
sort()  : $this
sortByName()  : $this
sortBySize()  : $this
finderWrapperAdd()  : mixed
Keep in memory Finder configuration
finderWrapperInject()  : mixed
Configure a Symfony Finder
newFinder()  : Finder
Return a new Symfony Finder configured

Properties

$wrappedMethodHistory

private mixed $wrappedMethodHistory = array()

Methods

__call()

Magic function to wrapper some Symfony Finder method

public __call(string $name, array<string|int, mixed> $arguments) : $this
Parameters
$name : string
$arguments : array<string|int, mixed>
Tags
throws
BadMethodCallException
Return values
$this

__construct()

Constructor.

public __construct(string $question[, mixed $default = null ]) : mixed
Parameters
$question : string

The question to ask to the user

$default : mixed = null

The default answer to return if the user enters nothing

changed()

public changed([string $date = ]) : $this
Parameters
$date : string =
Return values
$this

date()

public date([string $date = ]) : $this
Parameters
$date : string =
Return values
$this

directories()

public directories() : $this
Return values
$this

dots()

public dots([bool $ignoreDotFiles = ]) : $this
Parameters
$ignoreDotFiles : bool =
Return values
$this

filter()

public filter([callable $callable = ]) : $this
Parameters
$callable : callable =
Return values
$this
public followSymlinks() : $this
Return values
$this

getDefault()

Returns the default answer.

public getDefault() : mixed

getMaxAttempts()

Gets the maximum number of attempts.

public getMaxAttempts() : null|int

Null means an unlimited number of attempts.

Return values
null|int

getNormalizer()

Gets the normalizer for the response.

public getNormalizer() : string|Closure

The normalizer can ba a callable (a string), a closure or a class implementing __invoke.

Return values
string|Closure

getQuestion()

Returns the question.

public getQuestion() : string
Return values
string

getResultFor()

Get the list of directory and files that match the current partial path (or its parent directory)

public getResultFor(string $partialPath) : array<string|int, mixed>
Parameters
$partialPath : string
Tags
throws
InvalidArgumentException

if one of the directories does not exist

Return values
array<string|int, mixed>

getValidator()

Gets the validator for the question.

public getValidator() : null|callable
Return values
null|callable

modified()

public modified([string $date = ]) : $this
Parameters
$date : string =
Return values
$this

owner()

public owner([string $name = ]) : $this
Parameters
$name : string =
Return values
$this

setMaxAttempts()

Sets the maximum number of attempts.

public setMaxAttempts(null|int $attempts) : $this

Null means an unlimited number of attempts.

Parameters
$attempts : null|int
Tags
throws
InvalidArgumentException

In case the number of attempts is invalid.

Return values
$this

The current instance

setNormalizer()

Sets a normalizer for the response.

public setNormalizer(string|Closure $normalizer) : $this

The normalizer can be a callable (a string), a closure or a class implementing __invoke.

Parameters
$normalizer : string|Closure
Return values
$this

The current instance

setValidator()

Sets a validator for the question.

public setValidator(null|callable $validator) : $this
Parameters
$validator : null|callable
Return values
$this

The current instance

size()

public size([string $size = ]) : $this
Parameters
$size : string =
Return values
$this

sort()

public sort([callable $callable = ]) : $this
Parameters
$callable : callable =
Return values
$this

sortByName()

public sortByName() : $this
Return values
$this

sortBySize()

public sortBySize() : $this
Return values
$this

finderWrapperAdd()

Keep in memory Finder configuration

protected finderWrapperAdd(string $method, array<string|int, mixed> $args) : mixed
Parameters
$method : string
$args : array<string|int, mixed>

finderWrapperInject()

Configure a Symfony Finder

protected finderWrapperInject(Finder $finder) : mixed
Parameters
$finder : Finder

        
On this page

Search results