Skip to content

Instantly share code, notes, and snippets.

@manuelpichler
Forked from naderman/ReflectionFileSetQuery.php
Created December 31, 2009 17:38
Show Gist options
  • Save manuelpichler/266811 to your computer and use it in GitHub Desktop.
Save manuelpichler/266811 to your computer and use it in GitHub Desktop.
<?php
// set up include path
set_include_path(realpath(__DIR__ . '/../pflow/lib/') . PATH_SEPARATOR . get_include_path() . PATH_SEPARATOR);
require_once 'staticReflection/Autoloader.php';
spl_autoload_register(array(new org\pdepend\reflection\Autoloader, 'autoload'));
require_once 'ReflectionFileSetQuery.php';
use org\pdepend\reflection\ReflectionSession;
use org\pdepend\reflection\ReflectionClassProxyContext;
use org\pdepend\reflection\factories\NullReflectionClassFactory;
use org\pdepend\reflection\queries\ReflectionFileSetQuery;
$session = new ReflectionSession();
$session->addClassFactory( new NullReflectionClassFactory() );
// Should be moved into the "createFileSetQuery()" method
// $fileSetQuery = $session->createFileSetQuery();
$fileSetQuery = new ReflectionFileSetQuery(
new ReflectionClassProxyContext( $session )
);
$classes = $fileSetQuery->find(array('src/A.php', 'src/I.php'));
var_dump($classes[0]->getConstructor()); // Access constructor of A
var_dump($classes[0]->getInterfaces());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment