PHPackages                             mnapoli/phpdocreader - 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. mnapoli/phpdocreader

Abandoned → [php-di/phpdoc-reader](/?search=php-di%2Fphpdoc-reader)Library[Utility &amp; Helpers](/categories/utility)

mnapoli/phpdocreader
====================

PhpDocReader parses @var and @param values in PHP docblocks (supports namespaced class names with the same resolution rules as PHP)

2.2.1(5y ago)74256.5k↑383.3%154MITPHPPHP &gt;=7.2.0

Since Oct 15Pushed 4y ago2 watchersCompare

[ Source](https://github.com/PHP-DI/PhpDocReader)[ Packagist](https://packagist.org/packages/mnapoli/phpdocreader)[ RSS](/packages/mnapoli-phpdocreader/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (2)Versions (12)Used By (4)

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

[](#phpdocreader)

[![](https://camo.githubusercontent.com/e290328ef0d176788fdad3471e0ee68b656823c1f09ab2e745359393c96c6aa8/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f5048502d44492f706870646f632d7265616465722e737667)](https://camo.githubusercontent.com/e290328ef0d176788fdad3471e0ee68b656823c1f09ab2e745359393c96c6aa8/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f5048502d44492f706870646f632d7265616465722e737667)[![CI](https://github.com/PHP-DI/PhpDocReader/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/PHP-DI/PhpDocReader/actions/workflows/ci.yml)

This project is used by:

- [PHP-DI 6](http://php-di.org/)
- [Woohoo Labs. Zen](https://github.com/woohoolabs/zen)

Fork the README to add your project here.

Features
--------

[](#features)

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

```
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 PhpDocReader();

// 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

42

—

FairBetter than 90% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity47

Moderate usage in the ecosystem

Community24

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 84.6% 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 ~255 days

Recently: every ~445 days

Total

11

Last Release

2044d ago

Major Versions

1.3.0 → 2.0.02015-06-01

PHP version history (3 changes)1.0.0PHP &gt;=5.3.0

2.1.0PHP &gt;=5.4.0

2.2.0PHP &gt;=7.2.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/329a6111724074f5388e95dd41a03ccf3c43f4bfe1ecf27c94c9efc6f7823228?d=identicon)[mnapoli](/maintainers/mnapoli)

---

Top Contributors

[![mnapoli](https://avatars.githubusercontent.com/u/720328?v=4)](https://github.com/mnapoli "mnapoli (77 commits)")[![williamdes](https://avatars.githubusercontent.com/u/7784660?v=4)](https://github.com/williamdes "williamdes (6 commits)")[![thebigb](https://avatars.githubusercontent.com/u/2717179?v=4)](https://github.com/thebigb "thebigb (5 commits)")[![kocsismate](https://avatars.githubusercontent.com/u/6057627?v=4)](https://github.com/kocsismate "kocsismate (1 commits)")[![lvancrayelynghe](https://avatars.githubusercontent.com/u/1170965?v=4)](https://github.com/lvancrayelynghe "lvancrayelynghe (1 commits)")[![melbings](https://avatars.githubusercontent.com/u/15344864?v=4)](https://github.com/melbings "melbings (1 commits)")

---

Tags

phpdocreflection

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/mnapoli-phpdocreader/health.svg)

```
[![Health](https://phpackages.com/badges/mnapoli-phpdocreader/health.svg)](https://phpackages.com/packages/mnapoli-phpdocreader)
```

###  Alternatives

[phpdocumentor/reflection-common

Common reflection classes used by phpdocumentor to reflect the code structure

9.1k706.8M26](/packages/phpdocumentor-reflection-common)[barryvdh/laravel-ide-helper

Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.

14.9k123.0M687](/packages/barryvdh-laravel-ide-helper)[symfony/property-access

Provides functions to read and write from/to an object or array using a simple string notation

2.8k295.3M2.5k](/packages/symfony-property-access)[phpdocumentor/reflection

Reflection library to do Static Analysis for PHP Projects

12521.4M109](/packages/phpdocumentor-reflection)[php-di/phpdoc-reader

PhpDocReader parses @var and @param values in PHP docblocks (supports namespaced class names with the same resolution rules as PHP)

7431.6M55](/packages/php-di-phpdoc-reader)[symfony/type-info

Extracts PHP types information.

19951.9M114](/packages/symfony-type-info)

PHPackages © 2026

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