PHP Classes

File: readme.txt

Recommend this page to a friend!
  Classes of Artur Graniszewski   Advanced Sourcecode Reflection in PHP   readme.txt   Download  
File: readme.txt
Role: Documentation
Content type: text/plain
Description: Documentation
Class: Advanced Sourcecode Reflection in PHP
Retrieve extended class reflection information
Author: By
Last change: Reformated
Date: 13 years ago
Size: 1,240 bytes
 

Contents

Class file image Download
To use this library simplycreate instances of: * AdvancedReflectionClass, * AdvancedReflectionMethod, * AdvancedReflectionFunction, These are extending the ReflectionClass, ReflectionMethod and ReflectionFunction built in the PHP 5.x, so they are equipped with all the methods from the original Reflection PHP mechanism and additional ones: * getBody() returns source code (string) containing main body of the class/method/function * getDeclaration() returns source code (string) containing entire declaration of the class/method/function * getStartColumn() returns starting column number (integer) of the class/method/function in the starting line of code (getStartLine()). * getStartPosition() returns position (integer) of the first character of the class/method/function in the sourcecode file Example taken from the PHP manual and modified for this library: <?php namespace A\B; class Foo { public $test; } $function = new \System\Reflection\AdvancedReflectionClass('A\\B\\Foo'); var_dump($function->inNamespace()); var_dump($function->getName()); var_dump($function->getNamespaceName()); var_dump($function->getDeclaration()); ?> See examples files for futher info.