danog/class-finder
Fast PHP class discovery utility. Scan directories/files and find classes, interfaces, and traits without manually maintaining lists. Useful for autoload-based plugins, reflection tooling, and package indexing, with a simple API and minimal setup.
This exception only occurs in versions 0.3.x and lower.
Example PHP:
<?php
require_once __DIR__ . '/../vendor/autoload.php';
use danog\ClassFinder\ClassFinder;
$classes = ClassFinder::getClassesInNamespace('Acme\Foo\Bar');
Example composer.json:
{
"autoload": {
"psr-4": {
"Acme\\": "src/",
},
}
}
Results in this exception:
Unknown namespace 'Acme\Foo\Bar'
This exception occurs when the provided namespace isn't declared or isn't accessible based on items are are declared
in composer.json. In the given example, Acme is declared to map to src/ in composer.json, so PSR4 would mandate
that src/Foo/Bar is a valid path for a directory. However, that directory could not be located, and therefore the
provided namespace is unknown.
If you discover that this exception is raised and Composer can autoload classes found in the namespace, please submit an issue.
How can I help you explore Laravel packages today?