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.
string|null findClass(string $path)
Extract the class name from the file at the given path.
protected string|null getNamespace(int $key, array $tokens)
Find the namespace in the tokens starting at a given key.
protected string|null getClass(int $key, array $tokens)
Find the class in the tokens starting at a given key.
protected bool tokenIsNamespace(array|string $token)
Determine if the given token is a namespace keyword.
protected bool tokenIsClassOrInterface(array|string $token)
Determine if the given token is a class or interface keyword.
protected bool isPartOfNamespace(array|string $token)
Determine if the given token is part of the namespace.
protected bool isPartOfClass(array|string $token)
Determine if the given token is part of the class.
protected bool isWhitespace(array|string $token)
Determine if the given token is whitespace.
© Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
https://laravel.com/api/5.3/Illuminate/Filesystem/ClassFinder.html