PHPackages                             stein197/doxer - 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. stein197/doxer

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

stein197/doxer
==============

Simple phpdoc comment parser

1.2.1(4y ago)023MITPHPPHP &gt;=7.4

Since Jul 25Pushed 2y ago1 watchersCompare

[ Source](https://github.com/stein197/php-doxer)[ Packagist](https://packagist.org/packages/stein197/doxer)[ RSS](/packages/stein197-doxer/feed)WikiDiscussions main Synced 6d ago

READMEChangelogDependencies (1)Versions (6)Used By (0)

PHP docblock comment parser
===========================

[](#php-docblock-comment-parser)

Simple PHP documentation comment parser. First, install it via composer as follows:

```
composer require stein197/doxer

```

And then use it like this:

```
$docblock = getTags() as $tag) { // Returns and array of Stein197\Doxer\Tag instances
		$tag->getDescription(); // Handles multiple lines of description
		$tag->getName(); // Returns the name of the tag without "@" char
		foreach ($tag->getProperties() as $name => $value) { // Returns an array of properties
			"$name=$value"; // Tag's properties such as "version", "type", etc.
		}
	}
}
```

Each docblock comment can have tags which start with `@` sign and each tag can have an array of properties and an optional description. The next list shows which tags are currently supported:

- @author `` `[]`
- @deprecated `[]` `[]`
- @license `[]` `[]`
- @link `` `[]`
- @param `` `` `[]`
- @return `` `[]`
- @see `` `[]`
- @since `` `[]`
- @var `` `[]` `[]`
- @uses `` `[]`
- @throws `` `[]`

So for example if tag "@return string A string" is parsed, it's properties will only contain `type` entry:

```
$returnTag = (new Stein197\Doxer\Doc('/** @return string A string */'))->getTags()[0];
$returnTag->getDescription(); // "A string"
$returnTag->getProperties(); // ['type' => 'string']
```

But if the tag does not match any of predefined, then it will be parsed as `@tag []`. So for example if tag "@nonexistent string A string" is parsed, all it will contain is a description:

```
$tag = (new Stein197\Doxer\Doc('/** @nonexistent string A string */'))->getTags()[0];
$tag->getDescription(); // "string A string"
$tag->getProperties(); // null
```

If tag to be parsed can have properties but has incorrect syntax, properties and description will be nulls:

```
$tag = (new Stein197\Doxer\Doc('/** @param a b c d */'))->getTags()[0];
$tag->getDescription(); // null
$tag->getProperties(); // null
```

> NOTE! If tag accepts name property which will start with `$` sign (`@param`, `@var` tags), then after retrieving `name` property the name will be retrieved without leading "$":

```
$doc = new Stein197\Doxer\Doc('/** @param Type $arg1 */');
$doc->getTags()[0]->getProperties(); // ['name' => 'arg1']
```

API
---

[](#api)

The only class that is supposed to be used is `Stein197\Doxer\Doc`, which accepts a docblock string as the only constructor parameter. Then the next methods could be used:

MethodReturn typeDescription`getDescription()``string`Returns docblock description or `null` if it's not present`getTags(?string $name = null)``Stein197\Doxer\Tag[]`Returns an array of tags or null if there are no tags present. If optional parameter is passed then only tags with matching name will be retrieved`exists()``bool`Returns `true` if doc exists. Even empty description block treats as existing oneThe next table contains list of `Stein197\Doxer\Tag` public methods:

MethodReturn typeDescription`getDescription()``string`Returns tag description or `null` if it's not present`getName()``string`Returns the name of a tag without leading `@` sign`getProperties()``string[]`Returns an array of tag properties or null if there are no properties`getProperty(string $name)``string`Returns single property value or null if there is no such propertyTests
-----

[](#tests)

To run unit tests call the `test` composer script:

```
composer run test

```

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity55

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

Total

4

Last Release

1750d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/d8311ee6555571454bfa02135422b055fa0c19f360c827e9990535c9b140f81f?d=identicon)[stein197](/maintainers/stein197)

---

Top Contributors

[![stein197](https://avatars.githubusercontent.com/u/35802538?v=4)](https://github.com/stein197 "stein197 (42 commits)")

---

Tags

docblockparserphp

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/stein197-doxer/health.svg)

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

###  Alternatives

[mtdowling/jmespath.php

Declaratively specify how to extract elements from a JSON document

2.0k472.8M135](/packages/mtdowling-jmespathphp)[opis/closure

A library that can be used to serialize closures (anonymous functions) and arbitrary data.

2.6k230.0M284](/packages/opis-closure)[masterminds/html5

An HTML5 parser and serializer.

1.8k242.8M229](/packages/masterminds-html5)[sabberworm/php-css-parser

Parser for CSS Files written in PHP

1.8k191.2M65](/packages/sabberworm-php-css-parser)[michelf/php-markdown

PHP Markdown

3.5k52.4M345](/packages/michelf-php-markdown)[jms/metadata

Class/method/property metadata management in PHP

1.8k152.8M88](/packages/jms-metadata)

PHPackages © 2026

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