crodas/class-info

Get classes and functions defined in a given file

v0.2.6 2018-04-20 14:11 UTC

README

Get classes and functions defined in a given file. It implements a tiny PHP parser which gives you detailed informations about classes and functions defined in a file.

How to use it

<?php
require __DIR__ . "/vendor/autoload.php";

$parser = new crodas\ClassInfo\ClassInfo;
$parser->parse('demo.php');

foreach ($parser->getClasses() as $class) {
    foreach ($class->getMethods() as $method) {
    }
    foreach ($class->getProperties() as $prop) {
    }
    foreach ($class->getInterfaces() as $class) {
    }
}