Scan directories (for example vendor/, src/) for stuff.
Use ProjectScanner to find classes in directories.
public function doStuff()
{
$projectScanner = new ProjectScanner();
foreach ($projectScanner->findInDirectory('Entity') as $scanResult) {
echo $scanResult->getReference() . PHP_EOL;
echo $scanResult->getFileInfo()->getRelativePath() . PHP_EOL;
}
}
Output:
You\YourLibrary\Entity\Foo
src/You/YourLibrary/Entity/Foo.php
Me\MyLibrary\Entity\Foo\Bar
vendor/me/my-library/src/Entity/Foo/Bar.php