PHPackages                             rudra/annotation - 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. rudra/annotation

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

rudra/annotation
================

Class &amp; Method Annotation Reader

v26.1(4mo ago)15312MPL-2.0PHPPHP &gt;=8.3CI passing

Since Jun 25Pushed 4mo ago2 watchersCompare

[ Source](https://github.com/Jagepard/Rudra-Annotation)[ Packagist](https://packagist.org/packages/rudra/annotation)[ RSS](/packages/rudra-annotation/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (4)Dependencies (2)Versions (5)Used By (2)

[![PHPunit](https://github.com/Jagepard/Rudra-Annotation/actions/workflows/php.yml/badge.svg)](https://github.com/Jagepard/Rudra-Annotation/actions/workflows/php.yml)[![Maintainability](https://camo.githubusercontent.com/ce0e103d786272e47a2b5bdba50e8354b7e0e37fce4c974b88dc63fa1e6bf5c9/68747470733a2f2f716c74792e73682f6261646765732f35393766353034332d396166312d343937302d396565642d3836663335633735306135642f6d61696e7461696e6162696c6974792e737667)](https://qlty.sh/gh/Jagepard/projects/Rudra-Annotation)[![CodeFactor](https://camo.githubusercontent.com/5014293bd37d8bba39b93cf7479e08eafee9ad25d7743f0871a19a75594da079/68747470733a2f2f7777772e636f6465666163746f722e696f2f7265706f7369746f72792f6769746875622f6a616765706172642f72756472612d616e6e6f746174696f6e2f6261646765)](https://www.codefactor.io/repository/github/jagepard/rudra-annotation)[![Coverage Status](https://camo.githubusercontent.com/46c4973be17f96f447c1d8f7963e9f8d0f4da1660f792b6ccfbb9cad734e54d4/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f4a616765706172642f52756472612d416e6e6f746174696f6e2f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/Jagepard/Rudra-Annotation?branch=master)
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

[](#)

Annotations and attributes reader / Читатель аннотаций и атрибутов | [API](https://github.com/Jagepard/Rudra-Annotation/blob/master/docs.md "Documentation API")
----------------------------------------------------------------------------------------------------------------------------------------------------------------

[](#annotations-and-attributes-reader--читатель-аннотаций-и-атрибутов--api)

#### Installation / Установка

[](#installation--установка)

`composer require rudra/annotation`

#### Using / Использование

[](#using--использование)

```
$annotation = new Annotation();
```

##### An example of reading annotations / Пример чтения аннотаций

[](#an-example-of-reading-annotations--пример-чтения-аннотаций)

```
$annotation->getAnnotations(PageController::class);
$annotation->getAnnotations(PageController::class, "indexAction");
```

```
/**
 * @Routing(url = '')
 * @Defaults(name = 'user1', lastname = 'sample', age='0', address = {country : 'Russia'; state : 'Tambov'}, phone = '000-00000000')
 * @assertResult(false)
 * @Validate(name = 'min:150', phone = 'max:9')
 * @Middleware('Middleware', params = {int1 : '123'})
 * @Annotation(param1, param2 = 'param2', param3={param1;param2:'param2'})
 */
class PageController
{
    /**
     * @Routing(url = '')
     * @Defaults(name = 'user1', lastname = 'sample', age='0', address = {country : 'Russia'; state : 'Tambov'}, phone = '000-00000000')
     * @assertResult(false)
     * @Validate(name = 'min:150', phone = 'max:9')
     * @Middleware('Middleware', params = {int1 : '123'})
     * @Annotation(param1, param2 = 'param2', param3={param1;param2:'param2'})
     */
    public function indexAction()
    {
        // Your code
    }
}
```

##### An example of reading attributes / Пример чтения атрибутов

[](#an-example-of-reading-attributes--пример-чтения-атрибутов)

```
$annotation->getAttributes(PageController::class);
$annotation->getAttributes(PageController::class, "indexAction");
```

```
#[Routing(url:'')]
#[Defaults(name:'user1', lastname:'sample', age:'0', address:['country' => 'Russia', 'state' => 'Tambov'], phone:'000-00000000')]
#[assertResult(false)]
#[Validate(name:'min:150', phone:'max:9')]
#[Middleware('Middleware', params:['int1' => '123'])]
#[Annotation("param1", param2:'param2', param3:['param1', 'param2' => 'param2'])]
class PageController
{
    #[Routing(url:'')]
    #[Defaults(name:'user1', lastname:'sample', age:'0', address:['country' => 'Russia', 'state' => 'Tambov'], phone:'000-00000000')]
    #[assertResult(false)]
    #[Validate(name:'min:150', phone:'max:9')]
    #[Middleware('Middleware', params:['int1' => '123'])]
    #[Annotation("param1", param2:'param2', param3:['param1', 'param2' => 'param2'])]
    public function indexAction()
    {
        // Your code
    }
}
```

##### Result in both cases / Результат чтения в обоих случаях:

[](#result-in-both-cases--результат-чтения-в-обоих-случаях)

```
[
    'Routing' => [['url' => ""]],
    'Defaults' => [
        [
            'name' => "user1",
            'lastname' => "sample",
            'age' => "0",
            'address' => [
                'country' => "Russia",
                'state' => "Tambov",
            ],
            'phone' => "000-00000000",
        ],
    ],
    'assertResult' => [["false"]],
    'Validate' => [
        [
            'name' => "min:150",
            'phone' => "max:9",
        ],
    ],
    'Middleware' => [
        [
            "'Middleware'",
            'params' => [
                'int1' => '123',
            ],
        ],
    ],
    "Annotation" => [
        [
            "param1",
            "param2" => "param2",
            "param3" => [
                "param1",
                "param2" => "param2",
            ],
        ],
    ],
];
```

License
-------

[](#license)

This project is licensed under the **Mozilla Public License 2.0 (MPL-2.0)** — a free, open-source license that:

- Requires preservation of copyright and license notices,
- Allows commercial and non-commercial use,
- Requires that any modifications to the original files remain open under MPL-2.0,
- Permits combining with proprietary code in larger works.

📄 Full license text: [LICENSE](./LICENSE)
🌐 Official MPL-2.0 page:

---

Проект распространяется под лицензией **Mozilla Public License 2.0 (MPL-2.0)**. Это означает:

- Вы можете свободно использовать, изменять и распространять код.
- При изменении файлов, содержащих исходный код из этого репозитория, вы обязаны оставить их открытыми под той же лицензией.
- Вы **обязаны сохранять уведомления об авторстве** и ссылку на оригинал.
- Вы можете встраивать код в проприетарные проекты, если исходные файлы остаются под MPL.

📄 Полный текст лицензии (на английском): [LICENSE](./LICENSE)
🌐 Официальная страница:

###  Health Score

42

—

FairBetter than 90% of packages

Maintenance76

Regular maintenance activity

Popularity15

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 99.7% 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 ~61 days

Total

4

Last Release

140d ago

Major Versions

v25.12 → v26.12025-12-26

### Community

Maintainers

![](https://www.gravatar.com/avatar/75e65761bdd94035d1c783773a706d5722ce3164fe55d9722581c2cb4a642d8c?d=identicon)[jagepard](/maintainers/jagepard)

---

Top Contributors

[![Jagepard](https://avatars.githubusercontent.com/u/4591345?v=4)](https://github.com/Jagepard "Jagepard (391 commits)")[![codacy-badger](https://avatars.githubusercontent.com/u/23704769?v=4)](https://github.com/codacy-badger "codacy-badger (1 commits)")

---

Tags

annotationannotation-processingannotationsattributesrudraannotationsrudraannotationannotation-processing

### Embed Badge

![Health badge](/badges/rudra-annotation/health.svg)

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

###  Alternatives

[minime/annotations

The KISS PHP annotations library

229378.6k37](/packages/minime-annotations)[koriym/attributes

An annotation/attribute reader

433.4M12](/packages/koriym-attributes)[spiral/attributes

PHP attributes reader

233.6M45](/packages/spiral-attributes)[marcin-orlowski/lombok-php

Never write boilerplate code for your data class again!

3118.6k1](/packages/marcin-orlowski-lombok-php)[hyperf/di

A DI for Hyperf.

182.8M594](/packages/hyperf-di)[gomachan46/state-machine

simple state machine with annotations for PHP, inspired by AASM known as a Ruby state machine.

1893.9k](/packages/gomachan46-state-machine)

PHPackages © 2026

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