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)724.9k↓33.3%14MITPHPPHP ^8.1CI passing

Since Mar 30Pushed 1y 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 1mo ago

READMEChangelog (10)Dependencies (6)Versions (12)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.1+](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) [![MetaStorm](https://camo.githubusercontent.com/085213c192cc543a0c439dfb2c98d30f82248023c8cb5542ae5cb3cde111bd6a/68747470733a2f2f696d672e736869656c64732e696f2f7374617469632f76313f6c6162656c3d506f77657265642b6279266d6573736167653d4d6574612b53746f726d26636f6c6f723d646235383630267374796c653d666f722d7468652d6261646765266c6f676f3d646174613a696d6167652f737667253262786d6c3b6261736536342c50484e325a79423361575230614430694d5445784969426f5a576c6e61485139496a45784d534967646d6c6c64304a76654430694d434177494445784d5341784d54456949475a7062477739496d3576626d5569494868746247357a50534a6f644852774f693876643364334c6e637a4c6d39795a7938794d4441774c334e325a79492b50484268644767675a443069545459774c6a51324d5463674f45777a4d4334784e6a5530494467754d6a51334f554d794e7934794e4459674f4334794e7a45334f5341794e4334324e4467674d5441754d5441314944497a4c6a59304e7941784d6934344e446331544441754e444d774e546b674e7a59754f444d784e454d744d5334794e4451314f5341344d5334304d6a4134494449754d5463344d4455674f4459754d6a63784d7941334c6a41324d7a557a494467324c6a497a4d544e4d4d7a49754d5445354e7941344e6934774d6a597a54444d314c6a51784e4463674e7a59754f546b3554446b754f44637a4f5445674e7a63754d6a413454444d784c6a59794e546b674d5463754d6a4d324d6b77314e7934784e6a5932494445334c6a41794e7a4e4d4e6a41754e4459784e794134576949675a6d6c736244306949304647516a46434d794976506a78775958526f49475139496b30304f5334304d545135494445774d6934354f546c4d4e7a6b754e7a45794d6941784d4449754f546b35517a67794c6a597a4d5463674d5441794c6a6b354f5341344e5334794e445132494445774d5334784f4463674f4459754d6a593449446b344c6a51314d6a6c4d4d5445774c6a41784d79417a4e4334304e544930517a45784d5334334d6a59674d6a6b754f4463324f4341784d4467754d7a517a494449304c6a6b354f4455674d54417a4c6a51314e7941794e4334354f546731544463344c6a51774d4451674d6a51754f546b344e5577334e5334774d7a453249444d7a4c6a6b354f44564d4d5441774c6a55334d79417a4d7934354f546731544463344c6a4d794e544d674f544d754f546b35544455794c6a63344d7a63674f544d754f546b35544451354c6a51784e446b674d5441794c6a6b354f566f6949475a706247773949694e42526b4978516a4d694c7a3438634746306143426b50534a4e4d6a49674e6a464d4f4459674f4577314e7941314d4577344f5334354f546b33494451354c6a6b354f54644d4d6a59674d54417a544455314944597853444979576949675a6d6c736244306949304d334e5451314d434976506a777663335a6e50673d3d)](https://github.com/xepozz/meta-storm-idea-plugin)

 [![](https://camo.githubusercontent.com/d63311d586e1978842e0cddc2a0183e3b7f5d8ec9b5780137732a44b5ddb3700/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f7068702d747970652d6c616e67756167652f706870646f632f74657374732e796d6c3f6c6162656c3d5465737473267374796c653d666c61742d737175617265266c6f676f3d756e706b67)](https://github.com/php-type-language/phpdoc/actions/workflows/tests.yml) [![](https://camo.githubusercontent.com/a42ad6ed4b5bef63b94f9a0484df3d58d7c268498ca05dabf9f14f04c11a824b/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f7068702d747970652d6c616e67756167652f706870646f632f636f64657374796c652e796d6c3f6c6162656c3d5045522d322b436f64655374796c65267374796c653d666c61742d737175617265266c6f676f3d74656c656772617068)](https://github.com/php-type-language/phpdoc/actions/workflows/codestyle.yml) [![](https://camo.githubusercontent.com/135895662148f7342ddb00341f1deb9186dc63754d001c9e699a01052b903ed3/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f7068702d747970652d6c616e67756167652f706870646f632f7374617469632d616e616c797369732e796d6c3f6c6162656c3d5048505374616e267374796c653d666c61742d737175617265266c6f676f3d646174613a696d6167652f706e673b6261736536342c6956424f5277304b47676f414141414e53556845556741414143414141414167434159414141427a656e72304141414762306c455156523432753158653142555a52532f79344b67386f6952334643434255795345535a4252436961426e6d45734f7a65537a73672b4b7859594f3964454566744e52715a6a78343046525a6b5470716d4f7a3553324c73586c455a42636961746b516e484447596147644679314570474d486c2f702f5064466c7432726b354f2b4a396e356e412f767466356e6564336c6e6c49537052686166426c4c524c4843744a475672422f5a4244736177326c55717a526547414334364473745459666e534347556a61614476677841436f366a337655656e4e64496d65525871646e575635617a3572726e7a655a7a6e6a384a2b4535467473636c68663373344a3443532f6f52783542766f6e385a553635464759517841776366383561374365527a2b4334315448656a75657964435a3741414b33346e7776336b48502f6f554b644f4c344b373235386646374375643432374f3438525165476b49474a37374e38665a716c726366525034642f78393057516648584c65427439645472536c776c33563635796e574c4d315345413271624e51636b626534586d77773130486d79337368696430434d636d6c454a745344736c35565a42646641674d7649337575522b6d6f4a714e364c61786d70734f42654c43446d546966434239325263516d6241554a767471414c63357351723870383667594243634664427139774f696e374e5161783665776c423672714c5a486632334650313079336c6a36754a74454267324878695643747a64335345774d4243696f364e6839757a5a344f2f764c774f5a344f554e4d324e79494750467276757a42472f2f6c5250732b5651326b316b692b65506b64383462736b7a375946705967697a457a3838503876507a596666753364445330674a4e545531515856304e71616d70524b31574977676669453471684f7969673072432b7043764b3851556f4d4c37754a564841356b635155703344537071576a6333642f4479386f4b696f694c6f367571436f614568754862314b765430394141684246706257346c4f70794d797949425153436d6f55514c517a676e694e767a2b6f624232485332527742674536644f7843794a6f676d4e6b503275315772687734514a30332b69477252395845643343544e426e366543626f3430775044774d645856314246314456473571694574626f78535550364a37312b44334e775541684c4f4952517a6d376c6e6e68595576375146762f79445a2f4c6d3575624b3244564939695a386252384a4474454235376c4e7a454e514e364f6a6f49476c70616249565a7359614d544f2b6872696b525241314a786d5358396845372f734a745679463338744b735543565a7842687a396a49337747542f514a6c41447a50417958726e6a306b496e7a47485143524d794f672f65643275486a784975453454675951487132444c4a71756d617368592b6c6e734d433447564335646f365856754b396c2b34536b4e38792b47665965564a6e32672b2b553751796750543064426759474944765435386d6e46355051636a433833507a5346396648375331745a47456841515a514f54384a61413331376f496b4d366a533875564c53447a4f517167323355682b4d6c6b4f66303047673063503334632b7676373455527a4d396e34316762792f7276766b63374f54686c415455334e4347594a5558743451614c75545977426354534f426d6a315244374434547369783442794f6a5a52462f7a677570444562675a336a346c792f71656b704e44306f35615134344853344f416773567174493167545a4f303149624730615031626b6e6e7843445576417248692b42306c4a536c7a676c5446594f3275644633516c39544372486e356f45497265487036516c5255464a53556c4a43717169705357566c4a38764c79434759494653374853337a476138376d76346c636a4c774c6c53746c4c544b59595555416c76726c444763573435774b785858366171485a4e75744d2b316f51424846546577414b6b6f48342b7671436a3438505941475335796235616d6a4e6f4f2b435532534c35334e4b70444430767848486d4f4a6972374c357855765a676d307573325231343253634f4979567159766c70575534586f4849503844584c32622b776a6457655868365532466a6d49494b6d625741595046524d75733632682f676549766a4f51596c707544797351724c4c364765723439486757386a7176585568493755764462396961535444714874794974694635537577356577462f4e6438564a367a6c68736e30366245687758344e79664376754745655270546d68346d6b47363879447079757a42394555636a553561776241676e63506c4165536441514552307a436e647a715662655843347144734d70764745594258526e734478344e33417566314643546a5449615674592f51546d643049386242566d316b656a45756255664f30317671496d6e336334395837717065714939696e4967746270784b3359724b66494a43742b4f6556326e665556465234636134456b56454e794137676b59634d66423152354d4d6d785a37657a2f324b463553534e3179562b3135385550734a54305a4263493262524c744958476f5975354665724f55694a65314f66734c335845574834336c324b532b694a46392b53344670634e6773632b6a3863543848346f31626650672f716b4c743530754a31527a644d7347673055717766454e313134507762314374575447672b59395535436c4b397837785557493742493556515670304156635133625a6b51686d6e45676448684b794e535a65313663727442496c63377349623663524c6674325043676f4b476a696a4244746a72415137613345644d73787a4952666c414649685062366d48596d5977582b57426c505167736b6867567279794a4351794e79424c73425164513666677351687974364d534f4f73575a37676248387745546d67524b41696a61744e4c384e676d30787834744c6373707330577a7834616c306a586c493430422f413370613134344d447453674141414141456c46546b5375516d4343)](https://github.com/php-type-language/phpdoc/actions/workflows/static-analysis.yml)

Reference implementation for TypeLang PHPDoc Parser.

Read [documentation pages](https://typelang.dev) for more information.

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

[](#installation)

TypeLang PHPDoc Parser is available as Composer repository and can be installed using the following command in a root of your project:

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

Supported Tags
--------------

[](#supported-tags)

- `@abstract` - Declare any *Element* as abstract
- `@api` - Highlight *Element* as being part of the public API
- `@author` - TODO
- `@category` - Used to organize groups of packages together
- `@copyright` - Used to document the copyright information of any *Element*.
- `@deprecated` - TODO
- `@example` - TODO
- `@extends` - Allows to extend templated classes and interfaces
- `@filesource` - TODO
- `@final` - Declare any *Element* as final
- `@global` - TODO
- `@ignore` - Used to tell documentation systems that *Element* are not to be processed.
- `@implements` - Allows to extend templated interfaces
- `@inheritdoc` - TODO
- `@inherits` - An alias of `@extends` tag
- `@internal` - TODO
- `@license` - Used to indicate which license is applicable
- `@link` - Indicates a custom relation between the associated *Element*and a website, which is identified by an absolute URI
- `@method` - Allows a class to know which "*magic*" methods are callable
- `@mixin` - TODO
- `@no-named-arguments` - Indicates that argument names may be changed in the future.
- `@package` - Used to categorize *Element(s)* into logical subdivisions
- `@override` - Mention to see if the method is actually overriding a definition
- `@param` - Used to document a single argument of a function or method
- `@param-closure-this` - TODO
- `@param-immediately-invoked-callable` - TODO
- `@param-later-invoked-callable` - TODO
- `@param-out` - TODO
- `@property` - Used to declare which "*magic*" properties are supported
- `@property-read` - Used to declare which "*magic*" properties are supported for reading
- `@property-write` - Used to declare which "*magic*" properties are supported for writing
- `@pure-unless-callable-is-impure` - TODO
- `@readonly` - TODO
- `@require-extends` - TODO
- `@require-implements` - TODO
- `@return` - Used to document the return value of functions or methods
- `@returns` - An alias of `@return` tag
- `@seal-methods` - TODO
- `@seal-properties` - TODO
- `@see` - Indicates a reference from the associated *Symbol(s)* to a website or other *Symbol(s)*
- `@since` - TODO
- `@source` - TODO
- `@subpackage` - Used to categorize *Element(s)* into logical subdivisions
- `@suppress` - TODO
- `@template` - Allows classes (and class-like entries), functions and methods to declare a generic type parameter
- `@template-contravariant` - Allows classes (and class-like entries), functions and methods to declare a generic contravariant type parameter
- `@template-covariant` - Allows classes (and class-like entries), functions and methods to declare a generic covariant type parameter
- `@template-extends` - An alias of `@extends` tag
- `@template-implements` - An alias of `@implements` tag
- `@template-use` - Allows to extend templated traits
- `@throw` - An alias of `@throws` tag
- `@throws` - Used to indicate whether *Element* throw a specific type of `\Throwable` (exception or error)
- `@todo` - TODO
- `@unused-param` - TODO
- `@use` - An alias of `@template-use` tag
- `@used-by` - TODO
- `@uses` - TODO
- `@var` - Document the *Type* of the following *Element*
- `@version` - TODO

### Psalm Tags

[](#psalm-tags)

- `@psalm-allow-private-mutation` - TODO
- `@psalm-api` - Vendor-specific `@api` alias
- `@psalm-assert` - TODO
- `@psalm-assert-if-false` - TODO
- `@psalm-assert-if-true` - TODO
- `@psalm-assert-untainted` - TODO
- `@psalm-check-type` - TODO
- `@psalm-check-type-exact` - TODO
- `@psalm-consistent-constructor` - TODO
- `@psalm-consistent-templates` - TODO
- `@psalm-external-mutation-free` - TODO
- `@psalm-extends` - Vendor-specific `@extends` alias
- `@psalm-flow` - TODO
- `@psalm-if-this-is` - TODO
- `@psalm-ignore-falsable-return` - TODO
- `@psalm-ignore-nullable-return` - TODO
- `@psalm-ignore-var` - TODO
- `@psalm-ignore-variable-method` - TODO
- `@psalm-ignore-variable-property` - TODO
- `@psalm-immutable` - TODO
- `@psalm-implements` - Vendor-specific `@implements` alias
- `@psalm-import-type` - TODO
- `@psalm-inheritors` - TODO
- `@psalm-internal` - TODO
- `@psalm-method` - Vendor-specific `@method` alias
- `@psalm-mutation-free` - TODO
- `@psalm-no-seal-methods` - TODO
- `@psalm-no-seal-properties` - TODO
- `@psalm-override-method-visibility` - TODO
- `@psalm-override-property-visibility` - TODO
- `@psalm-param` - Vendor-specific `@param` alias
- `@psalm-param-out` - TODO
- `@psalm-property` - Vendor-specific `@property` alias
- `@psalm-property-read` - Vendor-specific `@property-read` alias
- `@psalm-property-write` - Vendor-specific `@property-write` alias
- `@psalm-pure` - TODO
- `@psalm-readonly` - TODO
- `@psalm-readonly-allow-private-mutation` - TODO
- `@psalm-require-extends` - TODO
- `@psalm-require-implements` - TODO
- `@psalm-return` - Vendor-specific `@return` alias
- `@psalm-scope-this` - TODO
- `@psalm-seal-methods` - TODO
- `@psalm-seal-properties` - TODO
- `@psalm-self-out` - TODO
- `@psalm-stub-override` - TODO
- `@psalm-suppress` - TODO
- `@psalm-taint-escape` - TODO
- `@psalm-taint-sink` - TODO
- `@psalm-taint-source` - TODO
- `@psalm-taint-specialize` - TODO
- `@psalm-taint-unescape` - TODO
- `@psalm-template` - Vendor-specific `@template` alias
- `@psalm-template-contravariant` - Vendor-specific `@template-contravariant` alias
- `@psalm-template-covariant` - Vendor-specific `@template-covariant` alias
- `@psalm-this-out` - TODO
- `@psalm-trace` - TODO
- `@psalm-type` - TODO
- `@psalm-use` - Vendor-specific `@use` alias
- `@psalm-var` - Vendor-specific `@var` alias
- `@psalm-variadic` - TODO
- `@psalm-yield` - TODO

### PHPStan Tags

[](#phpstan-tags)

- `@phpstan-allow-private-mutation` - TODO
- `@phpstan-assert` - TODO
- `@phpstan-assert-if-false` - TODO
- `@phpstan-assert-if-true` - TODO
- `@phpstan-consistent-constructor` - TODO
- `@phpstan-extends` - TODO
- `@phpstan-ignore` - TODO
- `@phpstan-ignore-line` - TODO
- `@phpstan-ignore-next-line` - TODO
- `@phpstan-immutable` - TODO
- `@phpstan-implements` - TODO
- `@phpstan-import-type` - TODO
- `@phpstan-impure` - TODO
- `@phpstan-method` - Vendor-specific `@method` alias
- `@phpstan-param` - Vendor-specific `@param` alias
- `@phpstan-param-closure-this` - TODO
- `@phpstan-param-immediately-invoked-callable` - TODO
- `@phpstan-param-later-invoked-callable` - TODO
- `@phpstan-param-out` - TODO
- `@phpstan-property` - Vendor-specific `@property` alias
- `@phpstan-property-read` - Vendor-specific `@property-read` alias
- `@phpstan-property-write` - Vendor-specific `@property-write` alias
- `@phpstan-pure` - TODO
- `@phpstan-pure-unless-callable-is-impure` - TODO
- `@phpstan-readonly` - TODO
- `@phpstan-readonly-allow-private-mutation` - TODO
- `@phpstan-require-extends` - TODO
- `@phpstan-require-implements` - TODO
- `@phpstan-return` - Vendor-specific `@return` alias
- `@phpstan-self-out` - TODO
- `@phpstan-template` - Vendor-specific `@template` alias
- `@phpstan-template-contravariant` - Vendor-specific `@template-contravariant` alias
- `@phpstan-template-covariant` - Vendor-specific `@template-covariant` alias
- `@phpstan-this-out` - TODO
- `@phpstan-throws` - Vendor-specific `@throws` alias
- `@phpstan-type` - TODO
- `@phpstan-use` - TODO
- `@phpstan-var` - Vendor-specific `@var` alias

### Phan Tags

[](#phan-tags)

- `@phan-abstract` - Vendor-specific `@abstract` alias
- `@phan-assert` - TODO
- `@phan-assert-false-condition` - TODO
- `@phan-assert-if-false` - TODO
- `@phan-assert-if-true` - TODO
- `@phan-assert-true-condition` - TODO
- `@phan-closure-scope` - TODO
- `@phan-constructor-used-for-side-effects` - TODO
- `@phan-extends` - Vendor-specific `@extends` alias
- `@phan-file-suppress` - TODO
- `@phan-forbid-undeclared-magic-methods` - TODO
- `@phan-forbid-undeclared-magic-properties` - TODO
- `@phan-hardcode-return-type` - TODO
- `@phan-immutable` - TODO
- `@phan-inherits` - Vendor-specific `@extends` alias
- `@phan-method` - Vendor-specific `@method` alias
- `@phan-mixin` - TODO
- `@phan-output-reference` - TODO
- `@phan-override` - Vendor-specific `@override` alias
- `@phan-param` - Vendor-specific `@param` alias
- `@phan-property` - Vendor-specific `@property` alias
- `@phan-property-read` - Vendor-specific `@property-read` alias
- `@phan-property-write` - Vendor-specific `@property-write` alias
- `@phan-pure` - TODO
- `@phan-read-only` - TODO
- `@phan-real-return` - TODO
- `@phan-return` - Vendor-specific `@return` alias
- `@phan-side-effect-free` - TODO
- `@phan-suppress-current-line` - TODO
- `@phan-suppress-next-line` - TODO
- `@phan-suppress-next-next-line` - TODO
- `@phan-suppress-previous-line` - TODO
- `@phan-template` - Vendor-specific `@template` alias
- `@phan-transient` - TODO
- `@phan-type` - TODO
- `@phan-unused-param` - TODO
- `@phan-var` - Vendor-specific `@var` alias
- `@phan-write-only` - TODO
- `@phanclosurescope` - TODO

Quick Start
-----------

[](#quick-start)

```
$parser = new \TypeLang\PHPDoc\Parser();
$result = $parser->parse( TypeLang\PHPDoc\DocBlock\Description\Description {
        #value: " and blah-blah-blah.\n"
      }
    ]
  }
  +tags: array:3 [
    0 => TypeLang\PHPDoc\DocBlock\Tag\Tag {
      +description: TypeLang\PHPDoc\DocBlock\Description\Description {
        #value: "("foo")\n"
      }
      +name: "Example\Annotation"
    }
    1 => TypeLang\PHPDoc\DocBlock\Tag\ReturnTag\ReturnTag {
      +description: null
      +name: "return"
      +type: TypeLang\Parser\Node\Stmt\NamedTypeNode { … }
    }
    2 => TypeLang\PHPDoc\DocBlock\Tag\ThrowsTag\ThrowsTag {
      +description: null
      +name: "throws"
      +type: TypeLang\Parser\Node\Stmt\NamedTypeNode { … }
    }
  ]
}
```

### Structural Elements

[](#structural-elements)

**DocBlock**

DocBlock is a representation of the comment object.

```
/**                                 |
 * Hello world                      | ← DocBlock's description.
 *                                  |
 * @param int $example              | ← DocBlock's tag #1.
 * @throws \Throwable Description   | ← DocBlock's tag #2.
 */                                 |
```

- `$description` ― Provides a `Description` object.
- `$tags` ― Provides a list of `Tag` objects.

```
/**
 * DocBlock structure pseudocode (real impl may differ)
 *
 * @template-implements \Traversable
 * @template-implements \ArrayAccess
 */
class DocBlock
{
    public ?Description $description { get; }

    public iterable $tags { get; }
}
```

**Description**

Description is a representation of the description object which may contain other tags.

```
/**
               ↓↓↓↓↓↓↓↓↓↓↓                         | ← This is a nested tag of the description.
 * Hello world {@see some} and blah-blah-blah.     |
   ↑↑↑↑↑↑↑↑↑↑↑             ↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑     | ← This is part of the template.
 */
```

- `$tags` ― Provides a list of `Tag` objects.
- `$components` ― Provides a list of `Tag|Description` objects.

```
/**
 * Simple description structure pseudocode (real impl may differ)
 */
class Description implements \Stringable {}

/**
 * Tagged (composite) description structure pseudocode (real impl may differ)
 *
 * @template-implements \Traversable
 * @template-implements \ArrayAccess
 */
class TaggedDescription extends Description implements
    \Traversable,
    \ArrayAccess,
    \Countable
{
    public iterable $tags { get; }

    public iterable $components { get; }
}
```

**Tag**

A Tag represents a name (ID) and its contents.

```
/**
    ↓↓↓↓↓↓                                 | ← This is a tag name.
 * @throws \Throwable An error occurred.   |
           ↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑   | ← This is tag description.
 */
```

- `$name` ― Provides a tag's name (ID).
- `$description` ― Provides an optional description of the tag.

```
/**
 * Common tag structure pseudocode (real impl may differ)
 */
class Tag implements \Stringable
{
    public non-empty-string $name { get; }

    public ?Description $description { get; }
}

/**
 * Throws tag structure pseudocode (real impl may differ)
 */
class ThrowsTag extends Tag
{
    public TypeStatement $type;
}
```

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance43

Moderate activity, may be stable

Popularity34

Limited adoption so far

Community14

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

Recently: every ~70 days

Total

11

Last Release

493d ago

### Community

Maintainers

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

---

Top Contributors

[![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.2k910.8M118](/packages/doctrine-lexer)[type-lang/parser

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

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

PHP documentation generator, with markdown output

169170.9k92](/packages/evert-phpdoc-md)[rajentrivedi/tokenizer-x

TokenizerX calculates required tokens for given prompt

91214.0k3](/packages/rajentrivedi-tokenizer-x)[voku/simple-php-code-parser

Get a simple data structure from your php code.

485.6k3](/packages/voku-simple-php-code-parser)

PHPackages © 2026

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