PHPackages                             reflective/reflection - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. reflective/reflection

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

reflective/reflection
=====================

Reflective is a formally defined reflection mechanism in PHP, which is used to query detailed information about classes, methods, properties, functions, etc.

v3.0.0(11mo ago)011.7k2MITPHPPHP ^8.0

Since Jan 16Pushed 11mo ago1 watchersCompare

[ Source](https://github.com/dependencies-packagist/reflective-reflection)[ Packagist](https://packagist.org/packages/reflective/reflection)[ Docs](https://github.com/dependencies-packagist/reflective-reflection)[ RSS](/packages/reflective-reflection/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (6)Used By (2)

Reflective Reflection
=====================

[](#reflective-reflection)

Reflective is a formally defined reflection mechanism in PHP, which is used to query detailed information about classes, methods, properties, functions, etc.

[![GitHub Tag](https://camo.githubusercontent.com/f4a3bf02b97451474f92c35a69ecab59e6f78cbfd775d769640aaa1fefa1ddcf/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f7461672f646570656e64656e636965732d7061636b61676973742f7265666c6563746976652d7265666c656374696f6e)](https://github.com/dependencies-packagist/reflective-reflection/tags)[![Total Downloads](https://camo.githubusercontent.com/edf62fac6a320714131121b9cf7f8774e2f6e7cce0be3a27aca2e41d969fb7bb/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7265666c6563746976652f7265666c656374696f6e3f7374796c653d666c61742d737175617265)](https://packagist.org/packages/reflective/reflection)[![Packagist Version](https://camo.githubusercontent.com/158fce3f4c79c3c430385b800a107c7a96b0f53969856c12bb98e5c6b099e80a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7265666c6563746976652f7265666c656374696f6e)](https://packagist.org/packages/reflective/reflection)[![Packagist PHP Version Support](https://camo.githubusercontent.com/4c8e444b4e0e289a99154f3145b043f0403a9ba9a814013aca7982432bab4e6d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f7265666c6563746976652f7265666c656374696f6e)](https://github.com/dependencies-packagist/reflective-reflection)[![Packagist License](https://camo.githubusercontent.com/ca9627e37d85c758baa34eb12bb82edd801285f821f9c41ea8c60b3cbbdecefe/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f646570656e64656e636965732d7061636b61676973742f7265666c6563746976652d7265666c656374696f6e)](https://github.com/dependencies-packagist/reflective-reflection)

Installation
------------

[](#installation)

You can install the package via [Composer](https://getcomposer.org/):

```
composer require reflective/reflection
```

Usage
-----

[](#usage)

### Gets an array of methods for current class.

[](#gets-an-array-of-methods-for-current-class)

```
use Reflective\Reflection\ReflectionClass;

$ref = new ReflectionClass(AccountController::class);
dd(
    $ref->getDeclaredMethods(),
    $ref->getDeclaredMethods(ReflectionMethod::IS_PUBLIC | ReflectionMethod::IS_PROTECTED),
);
```

### Returns an array of class parents.

[](#returns-an-array-of-class-parents)

```
use Reflective\Reflection\ReflectionClass;

$ref = new ReflectionClass(AccountController::class);
dd(
    $ref->getDeclaredParentClass(),
    $ref->getDeclaredParentClass(BaseController::class),
    $ref->getDeclaredParentClass(BaseController::class, ReflectionClass::IS_INSTANCEOF),
);
```

> **Note:** `Reflective\Reflection\ReflectionClass` is a subclass of `\ReflectionClass` and has the same methods.

```
use Reflective\Reflection\ReflectionParentClass;

$ref = new ReflectionParentClass(AccountController::class);
dd(
    $ref->getDeclaredParentClass(),
    $ref->getDeclaredParentClass(BaseController::class),
    $ref->getDeclaredParentClass(BaseController::class, ReflectionParentClass::IS_INSTANCEOF),
);
```

> **Note:** `Reflective\Reflection\ReflectionParentClass` is a subclass of `Reflective\Reflection\ReflectionClass` and has the same methods.

License
-------

[](#license)

Nacosvel Contracts is made available under the MIT License (MIT). Please see [License File](LICENSE) for more information.

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance50

Moderate activity, may be stable

Popularity21

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~33 days

Total

5

Last Release

355d ago

Major Versions

v1.0.0 → 2.x-dev2025-01-20

v2.0.0 → v3.0.02025-05-29

### Community

Maintainers

![](https://www.gravatar.com/avatar/2da9b458375a1b7972b7c4d26a5bf8f3e48db305e8805da36f253956f33c5568?d=identicon)[jundayw](/maintainers/jundayw)

---

Top Contributors

[![jundayw](https://avatars.githubusercontent.com/u/16873970?v=4)](https://github.com/jundayw "jundayw (15 commits)")

---

Tags

reflectionReflectorreflective

### Embed Badge

![Health badge](/badges/reflective-reflection/health.svg)

```
[![Health](https://phpackages.com/badges/reflective-reflection/health.svg)](https://phpackages.com/packages/reflective-reflection)
```

###  Alternatives

[phpdocumentor/reflection-common

Common reflection classes used by phpdocumentor to reflect the code structure

9.1k706.8M26](/packages/phpdocumentor-reflection-common)[symfony/property-access

Provides functions to read and write from/to an object or array using a simple string notation

2.8k295.3M2.5k](/packages/symfony-property-access)[phpdocumentor/reflection

Reflection library to do Static Analysis for PHP Projects

12521.4M109](/packages/phpdocumentor-reflection)[php-di/phpdoc-reader

PhpDocReader parses @var and @param values in PHP docblocks (supports namespaced class names with the same resolution rules as PHP)

7431.6M55](/packages/php-di-phpdoc-reader)[minime/annotations

The KISS PHP annotations library

229378.6k37](/packages/minime-annotations)[spatie/php-attribute-reader

A clean API for working with PHP attributes

80216.4k11](/packages/spatie-php-attribute-reader)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
