PHPackages                             type-lang/phpdoc - 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. type-lang/phpdoc

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

type-lang/phpdoc
================

Library for recognizing PHPDoc annotations in PHP DocBlock comments

1.0.1(1y ago)925.9k—3.8%14MITPHPPHP ^8.1CI passing

Since Mar 30Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/php-type-language/phpdoc)[ Packagist](https://packagist.org/packages/type-lang/phpdoc)[ RSS](/packages/type-lang-phpdoc/feed)WikiDiscussions master Synced 2w ago

READMEChangelog (10)Dependencies (6)Versions (13)Used By (4)

[ ![](https://github.com/php-type-language/.github/raw/master/assets/dark.png?raw=true)](https://github.com/php-type-language) [![PHP 8.4+](https://camo.githubusercontent.com/1b428237923c07dded3bbdb97798ef09fcead263a9b3df7cd2415511dabbcb7c/68747470733a2f2f706f7365722e707567782e6f72672f747970652d6c616e672f706870646f632f726571756972652f7068703f7374796c653d666f722d7468652d6261646765)](https://packagist.org/packages/type-lang/phpdoc) [![Latest Stable Version](https://camo.githubusercontent.com/b8c96e7c3a6bb23be2f7adaa21204f98dc5e7a8137123c2d6e98e461f692eb2c/68747470733a2f2f706f7365722e707567782e6f72672f747970652d6c616e672f706870646f632f76657273696f6e3f7374796c653d666f722d7468652d6261646765)](https://packagist.org/packages/type-lang/phpdoc) [![Latest Unstable Version](https://camo.githubusercontent.com/8f34f9e30a814c74f16eb5a1ad44ed315c557c8b0f18c3f4545a9d6afc064a17/68747470733a2f2f706f7365722e707567782e6f72672f747970652d6c616e672f706870646f632f762f756e737461626c653f7374796c653d666f722d7468652d6261646765)](https://packagist.org/packages/type-lang/phpdoc) [![License MIT](https://camo.githubusercontent.com/9ce2572d6ebaa409a318a1851e3afbc74273e36d7f938b68883db50974c30920/68747470733a2f2f706f7365722e707567782e6f72672f747970652d6c616e672f706870646f632f6c6963656e73653f7374796c653d666f722d7468652d6261646765)](https://raw.githubusercontent.com/php-type-language/phpdoc/blob/master/LICENSE)

 [![](https://camo.githubusercontent.com/d63311d586e1978842e0cddc2a0183e3b7f5d8ec9b5780137732a44b5ddb3700/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f7068702d747970652d6c616e67756167652f706870646f632f74657374732e796d6c3f6c6162656c3d5465737473267374796c653d666c61742d737175617265266c6f676f3d756e706b67)](https://github.com/php-type-language/phpdoc/actions/workflows/tests.yml)

---

The reference PHPDoc parser for **TypeLang**. It turns a raw `/** ... */`comment into an immutable, iterable object graph of its description and tags.

Full documentation is available at [typelang.dev](https://typelang.dev).

Installation
------------

[](#installation)

Install the package via [Composer](https://getcomposer.org):

```
composer require type-lang/phpdoc
```

**Requirements:**

- PHP 8.4+

Usage
-----

[](#usage)

`DocBlockParser::parse()` returns a `DocBlock` — an immutable collection of the comment's description and tags:

```
use TypeLang\PhpDoc\DocBlockParser;

$parser = new DocBlockParser();

$block = $parser->parse(reference; // "Mailer::send()"
```

### Structure

[](#structure)

A `DocBlock` is composed of three kinds of elements:

- **DocBlock** — the whole comment; behaves as a `Countable`, `IteratorAggregate`and `ArrayAccess` collection of its tags.
- **Description** — the leading text. A plain `Description` is just a string; a `TaggedDescription` also holds inline tags like `{@see ...}`.
- **Tag** — a name (without the leading `@`) and an optional description. Known tags (`@see`, `@link`, ...) extend the base `Tag` with their own parsed parts; an unregistered tag keeps its whole suffix as the description.

See the [documentation](https://typelang.dev) for the full list of supported tags.

###  Health Score

47

—

FairBetter than 93% of packages

Maintenance68

Regular maintenance activity

Popularity33

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 96.3% 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 ~76 days

Recently: every ~206 days

Total

12

Last Release

36d ago

Major Versions

1.0.1 → 2.0.0-beta12026-07-12

PHP version history (2 changes)1.0.0-beta1PHP ^8.1

2.0.0-beta1PHP ^8.4

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/150420?v=4)[Ruslan Sharipov](/maintainers/Serafim)[@serafim](https://github.com/serafim)

---

Top Contributors

[![SerafimArts](https://avatars.githubusercontent.com/u/2461257?v=4)](https://github.com/SerafimArts "SerafimArts (26 commits)")[![szepeviktor](https://avatars.githubusercontent.com/u/952007?v=4)](https://github.com/szepeviktor "szepeviktor (1 commits)")

---

Tags

analyzercommentsdocblockparserphpdocphpdoc-parserreadertypesphpphpdoclanguagedocblocktagsdictionary

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/type-lang-phpdoc/health.svg)

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

###  Alternatives

[doctrine/lexer

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

11.2k980.3M171](/packages/doctrine-lexer)[type-lang/parser

Library for parsing and validating TypeLang syntax and converting it into AST nodes

5160.7k6](/packages/type-lang-parser)[evert/phpdoc-md

PHP documentation generator, with markdown output

171175.6k96](/packages/evert-phpdoc-md)[rajentrivedi/tokenizer-x

TokenizerX calculates required tokens for given prompt

92261.6k3](/packages/rajentrivedi-tokenizer-x)

PHPackages © 2026

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