class ClassNameIndex (View source)

A filterable index of class names

Properties

protected array $classNames

Indexed array by class name

Methods

__construct(array $classNames = [])

Constructor. Note: If you pass a data array here, make sure to key sort it before!

void
setClassNames(array $classNames)

Set the data of this index to the given class names. Note: Make sure to sort the array before!

array
getClassNames()

Returns the class names contained in this index

bool
hasClassName(string $className)

Checks, if a class name is contained in this index

intersect(ClassNameIndex $classNameIndex)

Returns a new index object with all class names contained in this and the given index

void
applyIntersect(ClassNameIndex $classNameIndex)

Sets this index to all class names which are present currently and contained in the given index

union(ClassNameIndex $classNameIndex)

Returns a new index object containing all class names of this index and the given one

void
applyUnion(ClassNameIndex $classNameIndex)

Sets this index to all class names which are either already present or are contained in the given index

void
sort()

No description

int
count()

No description

filterByPrefix(string $prefixFilter)

Returns a new index object which contains all class names of this index starting with the given prefix

Details

__construct(array $classNames = [])

Constructor. Note: If you pass a data array here, make sure to key sort it before!

Parameters

array $classNames

Array with class names as keys

void setClassNames(array $classNames)

Set the data of this index to the given class names. Note: Make sure to sort the array before!

Parameters

array $classNames

Return Value

void

array getClassNames()

Returns the class names contained in this index

Return Value

array

An array of class names contained in this index

bool hasClassName(string $className)

Checks, if a class name is contained in this index

Parameters

string $className

The class name to check for

Return Value

bool

true, if the given class name is contained in this index

ClassNameIndex intersect(ClassNameIndex $classNameIndex)

Returns a new index object with all class names contained in this and the given index

Parameters

ClassNameIndex $classNameIndex

Return Value

ClassNameIndex

A new index object

void applyIntersect(ClassNameIndex $classNameIndex)

Sets this index to all class names which are present currently and contained in the given index

Parameters

ClassNameIndex $classNameIndex

Return Value

void

ClassNameIndex union(ClassNameIndex $classNameIndex)

Returns a new index object containing all class names of this index and the given one

Parameters

ClassNameIndex $classNameIndex

Return Value

ClassNameIndex

A new index object

void applyUnion(ClassNameIndex $classNameIndex)

Sets this index to all class names which are either already present or are contained in the given index

Parameters

ClassNameIndex $classNameIndex

Return Value

void

void sort()

No description

Return Value

void

int count()

No description

Return Value

int

The number of class names contained in this index

ClassNameIndex filterByPrefix(string $prefixFilter)

Returns a new index object which contains all class names of this index starting with the given prefix

Parameters

string $prefixFilter

A prefix string to filter the class names of this index

Return Value

ClassNameIndex

A new index object