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

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

jworman/annotation-reader
=========================

Allows the parsing of annotations within doc comments.

1.4.0(5y ago)0764MITPHPPHP &gt;=5.3CI failing

Since Jul 25Pushed 5y agoCompare

[ Source](https://github.com/hc-jworman/AnnotationReader)[ Packagist](https://packagist.org/packages/jworman/annotation-reader)[ RSS](/packages/jworman-annotation-reader/feed)WikiDiscussions master Synced 6d ago

READMEChangelog (10)Dependencies (2)Versions (11)Used By (0)

AnnotationReader
================

[](#annotationreader)

Install:

```
composer require jworman/annotation-reader

```

Example:

```
use JWorman\AnnotationReader\AbstractAnnotation;

class MyAnnotation extends AbstractAnnotation
{
}
```

```
use MyAnnotation;

class Example
{
    /**
     * @MyAnnotation("fizzbuzz")
     */
    private $id;
}
```

```
use JWorman\AnnotationReader\AnnotationReader;

$annotationReader = new AnnotationReader();
$reflectionProperty = new \ReflectionProperty('Example', 'id');
$annotation = $annotationReader->getPropertyAnnotation($reflectionProperty, 'MyAnnotation');
$value = $annotation->getValue(); // Returns "fizzbuzz"
```

Annotations can have any valid JSON value inside them.

```
/**
  * @MyAnnotation("fizzbuzz")
  * @AnotherOne({"isCool": true, "list": [null, false, {"nested": "object"}]})
  */
```

Annotations that define objects in their JSON will have their properties mapped to from the JSON.

```
use JWorman\AnnotationReader\AbstractAnnotation;

class AnotherOne extends AbstractAnnotation
{
    private $isCool; // From above annotations will equal: true
    private $list;   // From above annotations will equal: [null, false, \stdObject()]
}
```

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity56

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

Total

10

Last Release

2112d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/d774536cfcb0d3aee3349d9f686cfbb504521e5d170d81932f845632b77b1813?d=identicon)[hc\_jworman](/maintainers/hc_jworman)

---

Top Contributors

[![jack-worman](https://avatars.githubusercontent.com/u/66142217?v=4)](https://github.com/jack-worman "jack-worman (40 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[mtdowling/jmespath.php

Declaratively specify how to extract elements from a JSON document

2.0k472.8M135](/packages/mtdowling-jmespathphp)[opis/closure

A library that can be used to serialize closures (anonymous functions) and arbitrary data.

2.6k230.0M284](/packages/opis-closure)[masterminds/html5

An HTML5 parser and serializer.

1.8k242.8M229](/packages/masterminds-html5)[sabberworm/php-css-parser

Parser for CSS Files written in PHP

1.8k191.2M65](/packages/sabberworm-php-css-parser)[michelf/php-markdown

PHP Markdown

3.5k52.4M345](/packages/michelf-php-markdown)[jms/metadata

Class/method/property metadata management in PHP

1.8k152.8M88](/packages/jms-metadata)

PHPackages © 2026

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