All Projects → Roave → Betterreflection

Roave / Betterreflection

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

Projects that are alternatives of or similar to Betterreflection

Stalin Sort
Add a stalin sort algorithm in any language you like ❣️ if you like give us a ⭐️
Stars: ✭ 868 (-1.48%)
Mutual labels:  hacktoberfest
Swift Sdk
📱 The Watson Swift SDK enables developers to quickly add Watson Cognitive Computing services to their Swift applications.
Stars: ✭ 877 (-0.45%)
Mutual labels:  hacktoberfest
Phaservania
Small PhaserJS based Metroidvania-esque project.
Stars: ✭ 14 (-98.41%)
Mutual labels:  hacktoberfest
Pskoans
A simple, fun, and interactive way to learn the PowerShell language through Pester unit testing.
Stars: ✭ 868 (-1.48%)
Mutual labels:  hacktoberfest
Jbops
Just a Bunch Of Plex Scripts
Stars: ✭ 873 (-0.91%)
Mutual labels:  hacktoberfest
Woocommerce
An open source eCommerce plugin for WordPress.
Stars: ✭ 7,473 (+748.24%)
Mutual labels:  hacktoberfest
Supervisor
🏡 Home Assistant Supervisor
Stars: ✭ 862 (-2.16%)
Mutual labels:  hacktoberfest
Active Forks
Find active github forks of a repo https://git.io/vSnrC
Stars: ✭ 879 (-0.23%)
Mutual labels:  hacktoberfest
Oreboot
oreboot is a fork of coreboot, with C removed, written in Rust.
Stars: ✭ 874 (-0.79%)
Mutual labels:  hacktoberfest
Pysyft
A library for answering questions using data you cannot see
Stars: ✭ 7,811 (+786.61%)
Mutual labels:  hacktoberfest
Oh My Posh
A prompt theme engine for any shell.
Stars: ✭ 841 (-4.54%)
Mutual labels:  hacktoberfest
Azure Sdk For Js
This repository is for active development of the Azure SDK for JavaScript (NodeJS & Browser). For consumers of the SDK we recommend visiting our public developer docs at https://docs.microsoft.com/en-us/javascript/azure/ or our versioned developer docs at https://azure.github.io/azure-sdk-for-js.
Stars: ✭ 872 (-1.02%)
Mutual labels:  hacktoberfest
Kustomize
Customization of kubernetes YAML configurations
Stars: ✭ 7,880 (+794.44%)
Mutual labels:  hacktoberfest
Bakeware
Compile Elixir applications into single, easily distributed executable binaries
Stars: ✭ 865 (-1.82%)
Mutual labels:  hacktoberfest
Executor
Watch for file changes and then execute command. Very nice for test driven development.
Stars: ✭ 14 (-98.41%)
Mutual labels:  hacktoberfest
Swiftyjsonaccelerator
macOS app to generate Swift 5 code for models from JSON (with Codeable)
Stars: ✭ 864 (-1.93%)
Mutual labels:  hacktoberfest
Go Critic
The most opinionated Go source code linter for code audit.
Stars: ✭ 875 (-0.68%)
Mutual labels:  hacktoberfest
Adonis Ui
Lightweight UI toolkit for WPF applications offering classic but enhanced windows visuals
Stars: ✭ 878 (-0.34%)
Mutual labels:  hacktoberfest
Swiftinfo
📊 Extract and analyze the evolution of an iOS app's code.
Stars: ✭ 880 (-0.11%)
Mutual labels:  hacktoberfest
Swagger Editor
Swagger Editor
Stars: ✭ 7,365 (+735.98%)
Mutual labels:  hacktoberfest

Better Reflection

Mutation testing badge Type 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
  • 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!

Typically you would use Better Reflection for static analysis tooling. It can serve as a baseline to access type information (e.g. doc blocks, type declarations), method/function body AST fetching etc. for static analysis.

Better Reflection is NOT suited to runtime usage, since performance is much worse than PHP built-in reflection. If you do not want to do anything that native PHP reflection can't do, then just use native PHP reflection! The "Better" in Better Reflection refers to feature, not speed!

Be sure to read more in the feature documentation.

Installation

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.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].