PHPackages                             loot/phpdoc-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. loot/phpdoc-reader

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

loot/phpdoc-reader
==================

Package can parse phpdoc comments

v1.1(5y ago)0261MITPHP

Since Jan 30Pushed 5y ago1 watchersCompare

[ Source](https://github.com/Lootjs/phpdoc-reader)[ Packagist](https://packagist.org/packages/loot/phpdoc-reader)[ RSS](/packages/loot-phpdoc-reader/feed)WikiDiscussions main Synced 3w ago

READMEChangelog (1)DependenciesVersions (3)Used By (1)

PhpDocReader
============

[](#phpdocreader)

usage
-----

[](#usage)

```
$class = \App\Models\User::class;
$method = 'getChild';
$comment = (new \ReflectionMethod($class, $method))->getDocComment();
$res = new Loot\PhpDocReader\PhpDocReader($comment);

var_dump($res->getAnnotationsByName('@param'));
```

or just

```
$comment = '
/**
 * @param int $var Description
 */';
$res = new Loot\PhpDocReader\PhpDocReader($comment);

var_dump($res->getAnnotation('@param')->getDescription());
```

Classes
-------

[](#classes)

### Class PhpDocReader

[](#class-phpdocreader)

#### Method getAnnotation

[](#method-getannotation)

Получить первую аннотацию по названию.

```
$res = new Loot\PhpDocReader\PhpDocReader('
/**
  * @return int
  */');

var_dump($res->getAnnotation('@return')->getType());
```

#### Method getAnnotationsByName

[](#method-getannotationsbyname)

Получить все аннотации по названию.

```
$res = new Loot\PhpDocReader\PhpDocReader('
/**
  * @param int $int
  * @param string $string
  */');

var_dump($res->getAnnotationsByName('@param'));
```

#### Method getAnnotations

[](#method-getannotations)

Получить первую аннотацию.

```
$res = new Loot\PhpDocReader\PhpDocReader('
/**
  * @param int $int
  * @param string $string
  */');

var_dump($res->getAnnotations());
```

### Class PhpDocLine

[](#class-phpdocline)

#### Method getName()

[](#method-getname)

Возвращает название аннотации.

#### Method getType()

[](#method-gettype)

Возвращает тип аннотации.

#### Method getDescription()

[](#method-getdescription)

Возвращает описание аннотации.

#### Method getVariable()

[](#method-getvariable)

Возвращает переменную в аннотации.

###  Health Score

24

—

LowBetter than 31% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community9

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

Every ~20 days

Total

2

Last Release

1950d ago

Major Versions

v0.1 → v1.12021-02-19

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/6802491?v=4)[LOOT](/maintainers/Loot)[@loot](https://github.com/loot)

---

Top Contributors

[![Lootjs](https://avatars.githubusercontent.com/u/16526639?v=4)](https://github.com/Lootjs "Lootjs (1 commits)")

### Embed Badge

![Health badge](/badges/loot-phpdoc-reader/health.svg)

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

###  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)
