ClassFinder

class ClassFinder (View source)

Methods

array findClasses(string $directory)

Find all the class and interface names in a given directory.

string|null findClass(string $path)

Extract the class name from the file at the given path.

string|null getNamespace(int $key, array $tokens)

Find the namespace in the tokens starting at a given key.

string|null getClass(int $key, array $tokens)

Find the class in the tokens starting at a given key.

bool tokenIsNamespace(array|string $token)

Determine if the given token is a namespace keyword.

bool tokenIsClassOrInterface(array|string $token)

Determine if the given token is a class or interface keyword.

bool isPartOfNamespace(array|string $token)

Determine if the given token is part of the namespace.

bool isPartOfClass(array|string $token)

Determine if the given token is part of the class.

bool isWhitespace(array|string $token)

Determine if the given token is whitespace.

Details

array findClasses(string $directory)

Find all the class and interface names in a given directory.

Parameters

string $directory

Return Value

array

string|null findClass(string $path)

Extract the class name from the file at the given path.

Parameters

string $path

Return Value

string|null

protected string|null getNamespace(int $key, array $tokens)

Find the namespace in the tokens starting at a given key.

Parameters

int $key
array $tokens

Return Value

string|null

protected string|null getClass(int $key, array $tokens)

Find the class in the tokens starting at a given key.

Parameters

int $key
array $tokens

Return Value

string|null

protected bool tokenIsNamespace(array|string $token)

Determine if the given token is a namespace keyword.

Parameters

array|string $token

Return Value

bool

protected bool tokenIsClassOrInterface(array|string $token)

Determine if the given token is a class or interface keyword.

Parameters

array|string $token

Return Value

bool

protected bool isPartOfNamespace(array|string $token)

Determine if the given token is part of the namespace.

Parameters

array|string $token

Return Value

bool

protected bool isPartOfClass(array|string $token)

Determine if the given token is part of the class.

Parameters

array|string $token

Return Value

bool

protected bool isWhitespace(array|string $token)

Determine if the given token is whitespace.

Parameters

array|string $token

Return Value

bool

© Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
https://laravel.com/api/5.2/Illuminate/Filesystem/ClassFinder.html