PHPackages                             grajewsky/annotations - 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. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. grajewsky/annotations

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

grajewsky/annotations
=====================

PHP Annotations Reader OOP

v1.2.3(6y ago)112MITPHPCI failing

Since May 10Pushed 6y ago2 watchersCompare

[ Source](https://github.com/grajewsky/annotations)[ Packagist](https://packagist.org/packages/grajewsky/annotations)[ RSS](/packages/grajewsky-annotations/feed)WikiDiscussions master Synced 2w ago

READMEChangelogDependencies (2)Versions (3)Used By (0)

Annotations Reader for PHP [![](https://camo.githubusercontent.com/cbfde0f360e03a0d9c8cea8c38681c38b6382d816906bfd15e4bcf78aa4645d8/68747470733a2f2f7472617669732d63692e6f72672f6772616a6577736b792f616e6e6f746174696f6e732e7376673f6272616e63683d6d6173746572)](https://camo.githubusercontent.com/cbfde0f360e03a0d9c8cea8c38681c38b6382d816906bfd15e4bcf78aa4645d8/68747470733a2f2f7472617669732d63692e6f72672f6772616a6577736b792f616e6e6f746174696f6e732e7376673f6272616e63683d6d6173746572)
================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================

[](#annotations-reader-for-php-)

### Quick Use

[](#quick-use)

```
use \Annotations\Annotations;
/**
 * @Sample value=1
 * @SampleTest value=1, test=2
 **/
class EntityTestClass {
    /**
     * @Test
     */
    private $test = 1;
}
$annotations = Annotations::read(EntityTestClass::class);

print_r($annotations->annotations(Annotations::ALL_ANNOTATIONS));
```

#### About structure

[](#about-structure)

Statement `$a = Annotations::read(EntityTestClass::class);` return Annotations class where you can induce `$a->annotations($accessor)` method, where the parameter is the key is the character string, where the values are:

- pass const `Annotations::ALL_ANNOTATINS` - all the annotations(class and properties/methods) result is `Array`
- pass const `Annotations::CLASS_ANNOTATIONS` - accessor return Array&lt;String, Annotation&gt; - annotations of class
- pass property name or method to return annotations`

Output:

```
Array
(
    [class] => Array
        (
            [Sample] => Annotations\Domains\Annotation Object
                (
                    [fields:Annotations\Domains\Annotation:private] => Array
                        (
                            [value] => 1
                        )

                    [name:Annotations\Domains\Annotation:private] => Sample
                )

            [SampleTest] => Annotations\Domains\Annotation Object
                (
                    [fields:Annotations\Domains\Annotation:private] => Array
                        (
                            [value] => 1
                            [test] => 2
                        )

                    [name:Annotations\Domains\Annotation:private] => SampleTest
                )

        )

    [test] => Array
        (
            [ORM] => Annotations\Domains\Annotation Object
                (
                    [fields:Annotations\Domains\Annotation:private] => Array
                        (
                            [table] => entity
                        )

                    [name:Annotations\Domains\Annotation:private] => ORM
                )

            [Test] => Annotations\Domains\Annotation Object
                (
                    [fields:Annotations\Domains\Annotation:private] => Array
                        (
                        )

                    [name:Annotations\Domains\Annotation:private] => Test
                )

        )

)

```

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity61

Established project with proven stability

 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 ~156 days

Total

2

Last Release

2452d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/08fec7d2ad35f456cd3ef16e222d9344af07fb4bf0ee50e19c6ccb076552af37?d=identicon)[grajewsky](/maintainers/grajewsky)

---

Top Contributors

[![grajewsky](https://avatars.githubusercontent.com/u/17883113?v=4)](https://github.com/grajewsky "grajewsky (35 commits)")

---

Tags

phpparserannotationsdocblockcommentsannotationphp-parser

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/grajewsky-annotations/health.svg)

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

###  Alternatives

[doctrine/lexer

PHP Doctrine Lexer parser library that can be used in Top-Down, Recursive Descent Parsers.

11.2k942.7M153](/packages/doctrine-lexer)[jan-swiecki/simple-annotations

Simple annotation parser

68638.8k19](/packages/jan-swiecki-simple-annotations)

PHPackages © 2026

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