1. Go to this page and download the library: Download sun/staticreflection library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
sun / staticreflection example snippets
use Sun\StaticReflection\ReflectionClass;
$list = array();
foreach ($classmap as $classname => $pathname) {
$class = new ReflectionClass($classname, $pathname);
// Only Comment();
$list[$classname] = array(
'summary' => $doc_comment->getSummary(),
'covers' => $doc_comment->getAnnotations()['coversDefaultClass'][0],
);
}
echo json_encode($list, JSON_PRETTY_PRINT);
// Static reflection.
if (!$class->isSubclassOfAny(array('Condition\FirstFlavor', 'Condition\SecondFlavor'))) {
continue;
}
// Native reflection of ancestors (if the reflected class has any).
if (!$class->isSubclassOf('Condition\BaseFlavor')) {
continue;
}