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 1w 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

25

—

LowBetter than 35% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity55

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

1995d 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

[jakubledl/dissect

Lexing and parsing in pure PHP

2234.7M12](/packages/jakubledl-dissect)[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.

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

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

46164.0k6](/packages/jstewmc-rtf)[ladamalina/lingua-stem-ru

Стеммер Портера. Извлечение корня из русского слова, без словаря.

268.4k](/packages/ladamalina-lingua-stem-ru)[tcds-io/php-jackson

A lightweight, flexible object serializer for PHP, inspired by FasterXML/jackson

113.4k10](/packages/tcds-io-php-jackson)

PHPackages © 2026

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