Skip to content

đź”® Better Reflection is a reflection API that aims to improve and provide more features than PHP's built-in reflection API.

License

Notifications You must be signed in to change notification settings

proophsoftware/BetterReflection

This branch is 2746 commits behind Roave/BetterReflection:6.58.x.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

a6f46b1 Â· Oct 24, 2017
Sep 1, 2017
Sep 5, 2017
Sep 15, 2017
Sep 11, 2017
Sep 21, 2017
Sep 8, 2015
Jul 9, 2015
Sep 12, 2017
Jul 14, 2015
Jan 2, 2017
Sep 3, 2017
Sep 4, 2017
Sep 8, 2017
Oct 21, 2017
Sep 2, 2017
Sep 15, 2017
Aug 30, 2017
Nov 30, 2016

Repository files navigation

Better Reflection

Build Status Build Status Scrutinizer Code Quality Code Coverage Latest Stable Version License

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

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.

Installation

Simply require using composer:

$ composer require roave/better-reflection

Usage

<?php

use Roave\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.

Limitations

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

License

This package is released under the MIT license.

Contributing

If you wish to contribute to the project, please read the CONTRIBUTING notes.

About

đź”® Better Reflection is a reflection API that aims to improve and provide more features than PHP's built-in reflection API.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%