PHPackages                             kubomikita/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. kubomikita/reflection

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

kubomikita/reflection
=====================

Fork of Nette Reflection: docblock annotations parser and common reflection classes with php 8 compatibility

3.0.3(2y ago)022BSD-3-ClausePHPPHP &gt;=8.0

Since Jun 24Pushed 2y agoCompare

[ Source](https://github.com/kubomikita/reflection)[ Packagist](https://packagist.org/packages/kubomikita/reflection)[ Docs](https://nette.org)[ RSS](/packages/kubomikita-reflection/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependencies (5)Versions (16)Used By (0)

Nette PHP Reflection
====================

[](#nette-php-reflection)

[![Downloads this Month](https://camo.githubusercontent.com/26ed7211b7c2bac074970fde5bdb4d2f2bd52a0bcf2919d9697913791615087b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646d2f6e657474652f7265666c656374696f6e2e737667)](https://packagist.org/packages/nette/reflection)[![Build Status](https://camo.githubusercontent.com/391c855af508d5220978d39070649e08c1976cd2b143e625ee26f1ea8d6f99f5/68747470733a2f2f7472617669732d63692e6f72672f6e657474652f7265666c656374696f6e2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/nette/reflection)[![Coverage Status](https://camo.githubusercontent.com/5a05d0487399d77e0fed7b754396256ec04e413f3abde91faa633d779132b652/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f6e657474652f7265666c656374696f6e2f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/nette/reflection?branch=master)[![Latest Stable Version](https://camo.githubusercontent.com/0ac26bc99895c54d73111af4c28f971f9214b4e9e9bdb50b73e114b7ee8dd39d/68747470733a2f2f706f7365722e707567782e6f72672f6e657474652f7265666c656374696f6e2f762f737461626c65)](https://github.com/nette/reflection/releases)[![License](https://camo.githubusercontent.com/fa7d5fcf2c84b580327af52da95dd751703af65f079dc3c5a0081beac0789718/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4e65772532304253442d626c75652e737667)](https://github.com/nette/reflection/blob/master/license.md)

Install it using Composer:

```
composer require nette/reflection

```

The last stable release requires PHP version 5.6 or newer (is compatible with PHP 7.0 and 7.1).

If you like Nette, **[please make a donation now](https://nette.org/donate)**. Thank you!

If you need to find every information about any class, reflection is the right tool to do it. You can easily find out which methods does any class have, what parameters do those methods accept, etc.

```
// getting PDO class reflection
$classReflection = new Nette\Reflection\ClassType('PDO');

// getting PDO::query method reflection
$methodReflection = new Nette\Reflection\Method('PDO', 'query');
```

Annotations
-----------

[](#annotations)

Reflection has really a lot to do with annotations. The annotations are written into phpDoc comments (two opening asterisks are mandatory!) and start with `@`. You can annotate classes, variables and methods:

```
/**
 * @author John Doe
 * @author Tomas Marny
 * @secured
 */
class FooClass
{
	/** @Persistent */
	public $foo;

	/** @User(loggedIn, role=Admin) */
	public function bar() {}
}
```

In the code there are these annotations:

- `@author John Doe` - string, contains text value `'John Doe'`
- `@Persistent` - boolean, its presence means `true`
- `@User(loggedIn, role=Admin)` - contains associative `array('loggedIn', 'role' => 'Admin')`

The existence of a class annotation can be checked via `hasAnnotation()` method:

```
$fooReflection = new Nette\Reflection\ClassType('FooClass');
$fooReflection->hasAnnotation('author'); // returns true
$fooReflection->hasAnnotation('copyright'); // returns false
```

Values can be acquired with `getAnnotation()`:

```
$fooReflection->getAnnotation('author'); // returns string 'Tomas Marny'

$fooReflection->getMethod('bar')->getAnnotation('User');
// returns array('loggedIn', 'role' => 'Admin')
```

.\[caution\] Previous definitions are overwritten with the latter ones, sou you will always get the last one.

All annotations can be obtained with `getAnnotations()`:

```
array(3) {
	"author" => array(2) {
		0 => string(8) "John Doe"
		1 => string(11) "Tomas Marny"
	}
	"secured" => array(1) {
		0 => bool(true)
	}
}

```

###  Health Score

32

—

LowBetter than 69% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity76

Established project with proven stability

 Bus Factor1

Top contributor holds 86.1% 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 ~245 days

Recently: every ~578 days

Total

15

Last Release

963d ago

Major Versions

v2.3.x-dev → 3.0.02022-03-10

PHP version history (3 changes)v2.2.0PHP &gt;=5.3.1

v2.4.0PHP &gt;=5.6.0

3.0.2PHP &gt;=8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/f33189966ad3fe087ae5d1734aa00a079fcfcb5a17ecbc1f8780676d488e9b8e?d=identicon)[larryx](/maintainers/larryx)

---

Top Contributors

[![dg](https://avatars.githubusercontent.com/u/194960?v=4)](https://github.com/dg "dg (161 commits)")[![kubomikita](https://avatars.githubusercontent.com/u/6673118?v=4)](https://github.com/kubomikita "kubomikita (4 commits)")[![milo](https://avatars.githubusercontent.com/u/439140?v=4)](https://github.com/milo "milo (3 commits)")[![JanTvrdik](https://avatars.githubusercontent.com/u/175109?v=4)](https://github.com/JanTvrdik "JanTvrdik (3 commits)")[![vrana](https://avatars.githubusercontent.com/u/117453?v=4)](https://github.com/vrana "vrana (2 commits)")[![enumag](https://avatars.githubusercontent.com/u/539462?v=4)](https://github.com/enumag "enumag (2 commits)")[![fprochazka](https://avatars.githubusercontent.com/u/158625?v=4)](https://github.com/fprochazka "fprochazka (2 commits)")[![Majkl578](https://avatars.githubusercontent.com/u/144181?v=4)](https://github.com/Majkl578 "Majkl578 (2 commits)")[![juzna](https://avatars.githubusercontent.com/u/227416?v=4)](https://github.com/juzna "juzna (1 commits)")[![achtan](https://avatars.githubusercontent.com/u/1048212?v=4)](https://github.com/achtan "achtan (1 commits)")[![michalhlavka](https://avatars.githubusercontent.com/u/15013378?v=4)](https://github.com/michalhlavka "michalhlavka (1 commits)")[![greeny](https://avatars.githubusercontent.com/u/3734204?v=4)](https://github.com/greeny "greeny (1 commits)")[![OndraM](https://avatars.githubusercontent.com/u/793041?v=4)](https://github.com/OndraM "OndraM (1 commits)")[![tacoberu](https://avatars.githubusercontent.com/u/1828339?v=4)](https://github.com/tacoberu "tacoberu (1 commits)")[![VasekPurchart](https://avatars.githubusercontent.com/u/406821?v=4)](https://github.com/VasekPurchart "VasekPurchart (1 commits)")[![kravco](https://avatars.githubusercontent.com/u/115938?v=4)](https://github.com/kravco "kravco (1 commits)")

---

Tags

nettereflectionannotation

### Embed Badge

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

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

###  Alternatives

[nette/php-generator

🐘 Nette PHP Generator: generates neat PHP code for you. Supports new PHP 8.5 features.

2.3k72.7M766](/packages/nette-php-generator)[nette/component-model

⚛ Nette Component Model

28817.0M105](/packages/nette-component-model)[nette/code-checker

✅ Nette CodeChecker: A simple tool to check source code against a set of Nette coding standards.

911.7M6](/packages/nette-code-checker)[arachne/entity-loader

Enables object parameters in nette/application.

116.0k2](/packages/arachne-entity-loader)

PHPackages © 2026

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