2017 © Pedro PelĂĄez
 

library better-reflection

Better Reflection - an improved code reflection API

image

rector/better-reflection

Better Reflection - an improved code reflection API

  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 49 Forks
  • 0 Open issues
  • 15 Versions
  • 0 % Grown

The README.md

Better Reflection

Build Status Build Status Scrutinizer Code Quality Code Coverage Latest Stable Version License, (*1)

Better Reflection is a reflection API that aims to improve and provide more features than PHP's built-in reflection API., (*2)

Why is it better?

  • You can reflect on classes that are not already loaded, without loading them
  • Ability to reflect on classes directly from a string of PHP code
  • Better Reflection analyses the DocBlocks (using phpdocumentor/type-resolver)
  • Reflecting directly on closures
  • Ability to extract AST from methods and functions
  • Ability to return AST representation of a class or function
  • Fetch return type declaration and parameter type declarations in PHP 7 code (even when running PHP 5!)
  • Change or remove PHP 7 parameter type and return type declarations from methods and functions
  • Change the body of a function or method to do something different
  • Moar stuff coming soon!

Be sure to read more in the feature documentation., (*3)

Installation

Simply require using composer:, (*4)

$ composer require rector/better-reflection

Usage

<?php

use Rector\BetterReflection\BetterReflection;

$classInfo = (new BetterReflection())
    ->classReflector()
    ->reflect(\Foo\Bar\MyClass::class);

Documentation

Upgrading

Please refer to the Upgrade Documentation documentation to see what is required to upgrade your installed BetterReflection version., (*5)

Limitations

  • PHP cannot autoload functions, therefore we cannot statically reflect functions

License

This package is released under the MIT license., (*6)

Contributing

If you wish to contribute to the project, please read the CONTRIBUTING notes., (*7)

The Versions

02/04 2018
27/10 2017

v3.0.1

3.0.1.0

Better Reflection - an improved code reflection API

  Sources   Download

MIT

The Requires

 

The Development Requires

16/09 2017
26/09 2016

1.2.0

1.2.0.0

Better Reflection - an improved code reflection API

  Sources   Download

MIT

The Requires

 

The Development Requires

25/07 2016

1.1.0

1.1.0.0

Better Reflection - an improved code reflection API

  Sources   Download

MIT

The Requires

 

The Development Requires

07/02 2016

1.0.1

1.0.1.0

Better Reflection - an improved code reflection API

  Sources   Download

MIT

The Requires

 

The Development Requires

04/02 2016

1.0.0

1.0.0.0

Better Reflection - an improved code reflection API

  Sources   Download

MIT

The Requires

 

The Development Requires