PHPackages                             markuszeller/php-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. markuszeller/php-annotations

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

markuszeller/php-annotations
============================

Simple tool for parsing annotations

v1.0.0(6y ago)0285MITPHPPHP &gt;=7.1

Since Aug 4Pushed 6y ago1 watchersCompare

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

READMEChangelog (1)DependenciesVersions (2)Used By (0)

php-annotations
===============

[](#php-annotations)

This class helps reading annotations.

[![PHP from Packagist](https://camo.githubusercontent.com/3ef5ae2224ffcfcc090ffe13af804f0eab1750c45271d294f28d61ef0e411a8f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6d61726b75737a656c6c65722f7068702d616e6e6f746174696f6e732f76312e302e302e737667)](https://camo.githubusercontent.com/3ef5ae2224ffcfcc090ffe13af804f0eab1750c45271d294f28d61ef0e411a8f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6d61726b75737a656c6c65722f7068702d616e6e6f746174696f6e732f76312e302e302e737667)[![Install with Composer)](https://camo.githubusercontent.com/5a044970d4c50acb762b9e210d17c672617babcdaca01dcdb466e64c9603fcbc/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f636f6d706f7365722d6d61726b75737a656c6c65722532467068702d2d616e6e6f746174696f6e732d626c75652e737667)](https://camo.githubusercontent.com/5a044970d4c50acb762b9e210d17c672617babcdaca01dcdb466e64c9603fcbc/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f636f6d706f7365722d6d61726b75737a656c6c65722532467068702d2d616e6e6f746174696f6e732d626c75652e737667)

Features
--------

[](#features)

- reads from a string
- reads from a file
- supports multiline annotation values
- auto trims values

Note
----

[](#note)

Reads only annotations from DocComments included in `/** [...] */`.

Look into that **double asterisk**.

Usage
-----

[](#usage)

Initialise an Annotation object

```
require_once '../vendor/autoload.php';
use markuszeller\Annotations\Reader;

$reader = new Reader();

```

Put some data into the annotation reader instance

- by a string

    ```
      $cssString = file_get_contents('./template.css');
      $reader->loadFromString($cssString);

    ```
- by file

    ```
      if($reader->loadFromFile("./example.css") === false) {
          exit("Error loading file");
      }

    ```

Get all the annotations as an associative array

```
$annotationArray = $reader->getAnnotations();

```

Get a single annotation by name

```
$title = $reader->getAnnotation('title');

```

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity54

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

Unknown

Total

1

Last Release

2514d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/71471?v=4)[Markus Zeller](/maintainers/markuszeller)[@markuszeller](https://github.com/markuszeller)

---

Top Contributors

[![markuszeller](https://avatars.githubusercontent.com/u/71471?v=4)](https://github.com/markuszeller "markuszeller (2 commits)")

---

Tags

annotationscomposerpackageparserphp

### Embed Badge

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

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

###  Alternatives

[mck89/peast

Peast is PHP library that generates AST for JavaScript code

19037.7M41](/packages/mck89-peast)[karriere/json-decoder

JsonDecoder implementation that allows you to convert your JSON data into PHP class objects

140439.4k12](/packages/karriere-json-decoder)[sauladam/shipment-tracker

Parses tracking information for several carriers, like UPS, USPS, DHL and GLS by simply scraping the data. No need for any kind of API access.

9642.0k](/packages/sauladam-shipment-tracker)[jstewmc/rtf

Read and write Rich Text Format (RTF) documents with PHP

46143.1k6](/packages/jstewmc-rtf)[json-mapper/laravel-package

The JsonMapper package for Laravel

25188.9k3](/packages/json-mapper-laravel-package)[moonshine/layouts-field

Field for repeating groups of fields for MoonShine

107.9k](/packages/moonshine-layouts-field)

PHPackages © 2026

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