Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mindplay-dk/filereflection
⚠️ DEPRECATED ⚠️ Complements the PHP reflection API with the missing ReflectionFile class
https://github.com/mindplay-dk/filereflection
Last synced: about 2 months ago
JSON representation
⚠️ DEPRECATED ⚠️ Complements the PHP reflection API with the missing ReflectionFile class
- Host: GitHub
- URL: https://github.com/mindplay-dk/filereflection
- Owner: mindplay-dk
- Archived: true
- Created: 2014-07-18T19:52:33.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2023-11-25T10:51:29.000Z (about 1 year ago)
- Last Synced: 2024-09-23T11:38:34.727Z (3 months ago)
- Language: PHP
- Homepage:
- Size: 10.7 KB
- Stars: 2
- Watchers: 3
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
mindplay/filereflection
=======================#### ⚠️ DEPRECATED ⚠️ ####
> Consider using [`Roave/BetterReflection`](https://github.com/Roave/BetterReflection) instead.
https://github.com/mindplay-dk/filereflection
This library complements the PHP [reflection API](http://dk1.php.net/manual/en/book.reflection.php) with the missing ReflectionFile class.
[![Build Status](https://travis-ci.org/mindplay-dk/filereflection.png)](https://travis-ci.org/mindplay-dk/filereflection)
A few other libraries were available to do this already, but this one implements an
important feature missing from other implementations I could find: resolution of local
type-names according to the [name resolution rules](http://php.net/manual/en/language.namespaces.rules.php).The interface is very simple:
ReflectionFile {
public __construct( string $path )
public string getPath ( void )
public string getNamespaceName ( void )
public string resolveName ( string $name )
public ReflectionClass getClass ( string $name )
public ReflectionClass[] getClasses ( void )}
Usage of course is straight forward too:
use mindplay\filereflection\ReflectionFile;
$file = new ReflectionFile('/path/to/MyNamespace/MyClass.php');
var_dump($file->resolveName('MyOtherClass')); // => '\MyNamespace\MyOtherClass'
Note that this library currently omits reflection/enumeration of functions, constants, etc.