Reflection utilities for PHP8+

0.4.0 2025-02-27 13:47 UTC

This package is auto-updated.

Last update: 2025-02-27 13:48:49 UTC


README

Reflection utilities for PHP8+

Reflex offers extensions for PHP's built in reflection classes. These offer extra functionality for reflections, while respecting their respective contracts.

Installation

$ composer require monomelodies/reflex

Monomelodies\Reflex\ReflectionClass

Wrapper for ReflectionClass.

The AnyCallable class

<?php

use Reflex\AnyCallable;

$reflection = AnyCallable::reflect($someCallable);

This method returns the correct reflection for any type of callable (function or method). It also takes into account that in PHP, an abstract method is not considered callable.