PHPackages                             bvarent/doc-block-tags - 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. bvarent/doc-block-tags

ActiveLibrary

bvarent/doc-block-tags
======================

A library to read tags from DocBlocks in PHP class files.

v0.3(11y ago)018LGPL-3.0+PHPPHP &gt;=5.3.23

Since Jan 7Pushed 11y ago1 watchersCompare

[ Source](https://github.com/bvarent/doc-block-tags)[ Packagist](https://packagist.org/packages/bvarent/doc-block-tags)[ RSS](/packages/bvarent-doc-block-tags/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (7)Versions (5)Used By (0)

PHP DocBlock Tag Reader
=======================

[](#php-docblock-tag-reader)

A library to read tags from DocBlocks in PHP class files. Composed of phpDocumentor, Doctrine Annotations, and Typo3's ReflectionService.

Goals
-----

[](#goals)

- Be performant or at least cachable.
- Support custom tag definitions.
- Be a Zend Framework 2 module.
- Provide a ReflectionService.
- Create and manage Doctrine ReflectionClasses itself.
- ReflectionProperty::getType reads @var and class-&gt;@property tags.
- Provide information on a whole collection of classes.
- Get all subclasses of a class.
- Get all methods with a certain annotation.
- etc.
- Other useful stuff.

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

[](#installation)

- Add a requirement in your composer.json file.
- Override the default module configuration in your application.config. See the module.config for documentation.
- Unfortunately, at the moment you have to add some extra config to your composer.json file to have Typo3 installed correctly:
- If you're using doctrine 2.4.x:

```
{ "require": {"doctrine/orm": "2.4.x as 2.3"} }
```

- To install into the `vendor` dir instead of a `Packages` dir:

```
{
    "extra": {
        "installer-paths": "Typo3 by default installs in /Packages. We want it in /vendor.",
        "installer-paths": {
            "vendor/typo3/Packages/Framework/{$name}/": ["type:typo3-flow-framework"],
            "vendor/typo3/Packages/Application/{$name}/": ["type:typo3-flow-package"],
            "vendor/typo3/Packages/Plugins/{$name}/": ["type:typo3-flow-plugin"],
            "vendor/typo3/Packages/Sites/{$name}/": ["type:typo3-flow-site"],
            "vendor/typo3/Packages/Boilerplates/{$name}/": ["type:typo3-flow-boilerplate"],
            "vendor/typo3/Build/{$name}/": ["type:typo3-flow-build"]
        }
    }
}
```

Usage
-----

[](#usage)

```
// A class we want to read the tags from.
$testClassName = 'DocBlockTags\Tests\Mock\TaggedClass';

// Get your ZF2 servicemanager from somewhere.
$serviceManager = DocBlockTags\Tests\Bootstrap::getServiceManager();

// Get a Doctrine ReflectionClass for our class.
$classFinder = $serviceManager->get('DocBlockTags\ClassFinder');
$reflParser = new Doctrine\Common\Reflection\StaticReflectionParser($testClassName, $classFinder);
$testClassRefl = $reflParser->getReflectionClass();

// Read some tags.
$tagReader = $serviceManager->get('DocBlockTags\TagReader');
$tags = $tagReader->getClassAnnotations($testClassRefl);
```

Documentation
-------------

[](#documentation)

No more explicit documentation is available at this time.

ToDo
----

[](#todo)

- Cache the TagReader
- Is the TagReader usable by Doctrine\\Common\\Annotations\\CachedReader?
- Make cache configurable and
- Use cache from Doctrine Annotation Reader if configured in Doctrine Module?
- Write tests.
- Make the Reflection Service configurable.
- Make the Reflection Service cachable. (Use Doctrine cache?)
- Make a class to represent a type instead of a string.
- All //TODOs and @todos.
- Get rid of Typo3 dependency.
- More documentation.
- Custom tag classes.
- More examples.

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

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

Total

4

Last Release

4137d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0c25672fa8bfead35433ea51a84eb987ca37e930e5a46ac612eb3c0b618708f2?d=identicon)[bvarent](/maintainers/bvarent)

### Embed Badge

![Health badge](/badges/bvarent-doc-block-tags/health.svg)

```
[![Health](https://phpackages.com/badges/bvarent-doc-block-tags/health.svg)](https://phpackages.com/packages/bvarent-doc-block-tags)
```

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M651](/packages/sylius-sylius)[neos/flow

Flow Application Framework

862.0M451](/packages/neos-flow)[neos/flow-development-collection

Flow packages in a joined repository for pull requests.

144179.3k3](/packages/neos-flow-development-collection)[oat-sa/tao-core

TAO core extension

66136.7k74](/packages/oat-sa-tao-core)[concrete5/core

Concrete core subtree split

19159.3k48](/packages/concrete5-core)[2lenet/crudit-bundle

The easy like Crud'it Bundle.

1714.8k8](/packages/2lenet-crudit-bundle)

PHPackages © 2026

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