PHPackages                             frzb/php-doc-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. [Utility &amp; Helpers](/categories/utility)
4. /
5. frzb/php-doc-reader

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

frzb/php-doc-reader
===================

PhpDocReader parses @var and @param types

v2.0.0(2y ago)01.2k1MITPHPPHP &gt;=8.1

Since Jul 21Pushed 2y ago1 watchersCompare

[ Source](https://github.com/fractalzombie/frzb-php-doc-parser)[ Packagist](https://packagist.org/packages/frzb/php-doc-reader)[ Docs](https://github.com/fractalzombie/frzb-php-doc-parser)[ RSS](/packages/frzb-php-doc-reader/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (5)Dependencies (12)Versions (6)Used By (1)

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

[](#phpdocreader)

[![CI](https://github.com/fractalzombie/frzb-php-doc-parser/actions/workflows/build.yml/badge.svg?branch=master)](https://github.com/fractalzombie/frzb-php-doc-parser/actions/workflows/ci.yml)[![Bugs](https://camo.githubusercontent.com/4bfc632b432b1dc80451e474e3959992df251ccaab70395714eac17048e7baec/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d6672616374616c7a6f6d6269655f66727a622d7068702d646f632d706172736572266d65747269633d62756773)](https://sonarcloud.io/summary/new_code?id=fractalzombie_frzb-php-doc-parser)[![Security Rating](https://camo.githubusercontent.com/2011fb74a8b8847f280794e3de983a47547833f8d1e16dcd4c64fbd3c2f40040/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d6672616374616c7a6f6d6269655f66727a622d7068702d646f632d706172736572266d65747269633d73656375726974795f726174696e67)](https://sonarcloud.io/summary/new_code?id=fractalzombie_frzb-php-doc-parser)[![Maintainability Rating](https://camo.githubusercontent.com/39187c606d8d3f576f700cbb8823bd3e7b7f92349673d73992399ad2b6402a92/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d6672616374616c7a6f6d6269655f66727a622d7068702d646f632d706172736572266d65747269633d7371616c655f726174696e67)](https://sonarcloud.io/summary/new_code?id=fractalzombie_frzb-php-doc-parser)[![Code Smells](https://camo.githubusercontent.com/3ebcdc82c98c768dea6bf68187e25d3e5d2c28345892e1a898036e4c0aae8f6e/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d6672616374616c7a6f6d6269655f66727a622d7068702d646f632d706172736572266d65747269633d636f64655f736d656c6c73)](https://sonarcloud.io/summary/new_code?id=fractalzombie_frzb-php-doc-parser)[![Lines of Code](https://camo.githubusercontent.com/b5ff794aee9195fa3436a8e089fde409752545cbe3c4b750eed3737c3e5c6461/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d6672616374616c7a6f6d6269655f66727a622d7068702d646f632d706172736572266d65747269633d6e636c6f63)](https://sonarcloud.io/summary/new_code?id=fractalzombie_frzb-php-doc-parser)[![Coverage](https://camo.githubusercontent.com/85a72f93f0abc672100a8d36fd2acca4ab4e87b1e8acfc5b7fbb8808c226eabd/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d6672616374616c7a6f6d6269655f66727a622d7068702d646f632d706172736572266d65747269633d636f766572616765)](https://sonarcloud.io/summary/new_code?id=fractalzombie_frzb-php-doc-parser)[![Technical Debt](https://camo.githubusercontent.com/5ee18eeb658a70ee5893b12544b25b25d480a8911fdcda50b59bc253503752a2/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d6672616374616c7a6f6d6269655f66727a622d7068702d646f632d706172736572266d65747269633d7371616c655f696e646578)](https://sonarcloud.io/summary/new_code?id=fractalzombie_frzb-php-doc-parser)[![Reliability Rating](https://camo.githubusercontent.com/330084dc850c88ffc0c7b6598a3a0025d2df61044e5dc904f550bfadfb8f19f5/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d6672616374616c7a6f6d6269655f66727a622d7068702d646f632d706172736572266d65747269633d72656c696162696c6974795f726174696e67)](https://sonarcloud.io/summary/new_code?id=fractalzombie_frzb-php-doc-parser)[![Duplicated Lines (%)](https://camo.githubusercontent.com/eda0611efa36b01f62181a403d49f45c937bedc193ec8c4147fadd051b87432b/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d6672616374616c7a6f6d6269655f66727a622d7068702d646f632d706172736572266d65747269633d6475706c6963617465645f6c696e65735f64656e73697479)](https://sonarcloud.io/summary/new_code?id=fractalzombie_frzb-php-doc-parser)[![Vulnerabilities](https://camo.githubusercontent.com/239e5f0f903477c2cdf07b456e49993bf50c9fa6e2ad8e696d51392e9fc13b2a/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d6672616374616c7a6f6d6269655f66727a622d7068702d646f632d706172736572266d65747269633d76756c6e65726162696c6974696573)](https://sonarcloud.io/summary/new_code?id=fractalzombie_frzb-php-doc-parser)

Features
--------

[](#features)

PhpDocReader parses `@var` and `@param` values in PHP DocBlock:

```
use My\Cache\Backend;

class Cache
{
    /**
     * @var Backend
     */
    protected $backend;

    /**
     * @param Backend $backend
     */
    public function __construct($backend)
    {
    }
}
```

It supports namespaced class names with the same resolution rules as PHP:

- fully qualified name (starting with `\`)
- imported class name (eg. `use My\Cache\Backend;`)
- relative class name (from the current namespace, like `SubNamespace\MyClass`)
- aliased class name (eg. `use My\Cache\Backend as FooBar;`)

Primitive types (`@var string`) are ignored (returns null), only valid class names are returned.

Usage
-----

[](#usage)

```
$reader = new Reader();

// Read a property type (@var phpdoc)
$property = new ReflectionProperty($className, $propertyName);
$propertyClass = $reader->getPropertyClass($property);

// Read a parameter type (@param phpdoc)
$parameter = new ReflectionParameter([$className, $methodName], $parameterName);
$parameterClass = $reader->getParameterClass($parameter);
```

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity60

Established project with proven stability

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

Total

5

Last Release

874d ago

Major Versions

v1.2.0 → v2.0.02023-12-26

PHP version history (2 changes)v1.0.0PHP ^8.1

v2.0.0PHP &gt;=8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/3874c03818bc669a9c692b7eafc94f7e55d06fccd7f214c4ee7408ac370214c2?d=identicon)[fractalzombie](/maintainers/fractalzombie)

---

Top Contributors

[![fractalzombie](https://avatars.githubusercontent.com/u/5721336?v=4)](https://github.com/fractalzombie "fractalzombie (5 commits)")

---

Tags

symfonyphpdocdependencyinjectionreflectionlibrarycomponent

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/frzb-php-doc-reader/health.svg)

```
[![Health](https://phpackages.com/badges/frzb-php-doc-reader/health.svg)](https://phpackages.com/packages/frzb-php-doc-reader)
```

###  Alternatives

[phpdocumentor/reflection-common

Common reflection classes used by phpdocumentor to reflect the code structure

9.1k706.8M26](/packages/phpdocumentor-reflection-common)[winzou/state-machine-bundle

Bundle for the very lightweight yet powerful PHP state machine

34010.4M15](/packages/winzou-state-machine-bundle)

PHPackages © 2026

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