paveldanilin/reflection-scanner

v0.0.1 2021-11-28 09:53 UTC

This package is auto-updated.

Last update: 2024-03-28 14:39:16 UTC


README

Scans directories for class reflection info.

Supports DocBlock annotations (Doctrine annotation).

Example:

$scanner = new \Pada\Reflection\Scanner\Scanner();

/** @var \Pada\Reflection\Scanner\ClassInfo $classInfo */
foreach ($scanner->in('../vendor') as $classInfo) {
    print "----------------------------\n";
    print "File:" . $classInfo->getFilename() . "\n";
    print "Class:" . $classInfo->getReflection()->getShortName() . "\n";
    foreach ($classInfo->getMethodNames() as $methodName) {
        print $classInfo->getReflection()->getShortName() . '.' . $methodName . "\n";
        print_r(\iterator_to_array($classInfo->getMethodAnnotations($methodName)));
    }
}