class ClassFinder

Class finder.

Constants

PHP_FILENAME_PATTERN

PHP filename pattern.

Properties

protected Finder $finder Finder instance.
protected bool $includeClasses Should classes be included?
protected bool $includeAbstractClasses Should abstract classes be included?
protected bool $includeInterfaces Should interfaces be included?
protected bool $includeTraits Should traits be included?

Methods

__construct(Finder $finder)

Constructor.

$this
includeClasses()

Includes abstract classes.

$this
excludeClasses()

Excludes abstract classes.

$this
includeAbstractClasses()

Includes abstract classes.

$this
excludeAbstractClasses()

Excludes abstract classes.

$this
includeInterfaces()

Includes interfaces.

$this
excludeInterfaces()

Excludes interfaces.

$this
includeTraits()

Includes traits.

$this
excludeTraits()

Excludes traits.

array
getAllowedClasslikeTokens()

Returns the tokens we're searching for.

array
getNamespaceTokens()

Returns tokens that should be used to match namespace names.

string|null
findClassInFile(string $path)

Finds the class in a PHP file.

findClasses()

Returns all the classes.

find()

Returns all the classes.

findImplementing(string $interfaceName)

Returns all the classes implementing the interface.

findExtending(string $className)

Returns all the classes extending the class.

findUsing(string $traitName)

Returns all the classes using the trait.

Details

at line 73
__construct(Finder $finder)

Constructor.

Parameters

Finder $finder Finder instance

at line 88
$this includeClasses()

Includes abstract classes.

Return Value

$this

at line 100
$this excludeClasses()

Excludes abstract classes.

Return Value

$this

at line 112
$this includeAbstractClasses()

Includes abstract classes.

Return Value

$this

at line 124
$this excludeAbstractClasses()

Excludes abstract classes.

Return Value

$this

at line 136
$this includeInterfaces()

Includes interfaces.

Return Value

$this

at line 148
$this excludeInterfaces()

Excludes interfaces.

Return Value

$this

at line 160
$this includeTraits()

Includes traits.

Return Value

$this

at line 172
$this excludeTraits()

Excludes traits.

Return Value

$this

at line 184
protected array getAllowedClasslikeTokens()

Returns the tokens we're searching for.

Return Value

array

at line 211
protected array getNamespaceTokens()

Returns tokens that should be used to match namespace names.

Return Value

array

at line 227
protected string|null findClassInFile(string $path)

Finds the class in a PHP file.

Parameters

string $path Path to PHP file

Return Value

string|null

at line 278
protected Generator findClasses()

Returns all the classes.

Return Value

Generator

at line 294
Generator find()

Returns all the classes.

Return Value

Generator

at line 305
Generator findImplementing(string $interfaceName)

Returns all the classes implementing the interface.

Parameters

string $interfaceName Interface name

Return Value

Generator

at line 322
Generator findExtending(string $className)

Returns all the classes extending the class.

Parameters

string $className Class name

Return Value

Generator

at line 339
Generator findUsing(string $traitName)

Returns all the classes using the trait.

Parameters

string $traitName Trait name

Return Value

Generator