kwaight / classfinder
A utility for obtaining fully qualified class names from a directory.
This package's canonical repository appears to be gone and the package has been frozen as a result. Email us for help if needed.
Installs: 2 009
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 1
pkg:composer/kwaight/classfinder
Requires
- symfony/finder: ~4.0
Requires (Dev)
- phpunit/phpunit: ^5.7
This package is not auto-updated.
Last update: 2025-06-13 07:56:33 UTC
README
This is a class adapted from the old Illuminate\FileSystem\ClassFinder class that was in the Laravel source once upon a time.
Call ClassFinder::findClasses($path) to obtain a list of fully qualified class names from the given directory.
By default this will match any file with an extension of .php, but a second optional parameter can be passed in to provide a different matching pattern (eg *Service.php)
If the directory is potentially non-existent, ClassFinder::findClassesSafely($path) can be called, which will return an empty array if the directory does not exist.
A fully qualified class name for a single class may also be obtained through ClassFinder::findClass($pathToClass)