PHPackages                             phpowermove/docblock - 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. phpowermove/docblock

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

phpowermove/docblock
====================

PHP Docblock parser and generator. An API to read and write Docblocks.

v4.0(4y ago)2524.0M—2.8%64MITPHPPHP &gt;=8.0CI failing

Since May 28Pushed 4y ago2 watchersCompare

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

READMEChangelog (10)Dependencies (5)Versions (16)Used By (4)

Docblock
========

[](#docblock)

[![License](https://camo.githubusercontent.com/1b50f754b9c29adbb5886f6d02ad2b7e15136a310015d7015530ffed25a9305d/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f7068706f7765726d6f76652f646f63626c6f636b2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/phpowermove/docblock)[![Latest Stable Version](https://camo.githubusercontent.com/1780cc9b960ea740247b91a4ee4680739a2cf3537b64094b755789176bc1f091/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7068706f7765726d6f76652f646f63626c6f636b2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/phpowermove/docblock)[![Total Downloads](https://camo.githubusercontent.com/3be2ca96d7e916b925136ffab368f3ca9961aef2df6ca039807060ce27dd338d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7068706f7765726d6f76652f646f63626c6f636b2e7376673f7374796c653d666c61742d73717561726526636f6c6f72423d303037656336)](https://packagist.org/packages/phpowermove/docblock)[![Tests](https://github.com/phpowermove/docblock/workflows/Docblock%20Test%20Suite/badge.svg)](https://github.com/phpowermove/docblock/workflows/Docblock%20Test%20Suite/badge.svg)[![Coverage report](https://github.com/phpowermove/docblock/workflows/Coverage/badge.svg)](https://github.com/phpowermove/docblock/workflows/Coverage/badge.svg)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/660ec46ffd45315bcf15099ef43f80d5fd96594f880eebab9e243d3525558f12/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f7068706f7765726d6f76652f646f63626c6f636b2f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/phpowermove/docblock/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/987aae3affa0ad4c2519a60e08d34ddd6f14d29819ebe48f2a2529966e3746df/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f7068706f7765726d6f76652f646f63626c6f636b2f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/phpowermove/docblock/?branch=master)

PHP Docblock parser and generator. An API to read and write Docblocks.

> **WARNING**: starting from version 4.0 the library has moved to [phpowermove organization](https://github.com/phpowermove) and the namespace is `phpowermove\docblock`.

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

[](#installation)

Install via Composer:

```
composer require phpowermove/docblock

```

Usage
-----

[](#usage)

### 1. Generate a Docblock instance

[](#1-generate-a-docblock-instance)

a) Simple:

```
use phpowermove\docblock\Docblock;

$docblock = new Docblock();
```

b) Create from string:

```
use phpowermove\docblock\Docblock;

$docblock = new Docblock('/**
 * Short Description.
 *
 * Long Description.
 *
 * @author gossi
 */');
```

c) Create from reflection:

```
use phpowermove\docblock\Docblock;

$docblock = new Docblock(new \ReflectionClass('MyClass'));
```

### 2. Manipulate tags

[](#2-manipulate-tags)

Get the tags:

```
$tags = $docblock->getTags();
```

Get tags by name:

```
$tags = $docblock->getTags('author');
```

Append a tag:

```
use phpowermove\docblock\tags\AuthorTag;

$author = new AuthorTag();
$author->setName('gossi');
$docblock->appendTag($author);
```

or with fluent API:

```
use phpowermove\docblock\tags\AuthorTag;

$docblock->appendTag(AuthorTag::create()
	->setName('gossi')
);
```

Check tag existence:

```
$docblock->hasTag('author');
```

### 3. Get back the string

[](#3-get-back-the-string)

Call `toString()`:

```
$docblock->toString();
```

or if you are in a write-context, the magical `__toString()` will take care of it:

```
echo $docblock;
```

Documentation Api
-----------------

[](#documentation-api)

See

Contributing
------------

[](#contributing)

Feel free to fork and submit a pull request (don't forget the tests) and I am happy to merge.

References
----------

[](#references)

- This project uses the parsers from [phpDocumentor/ReflectionDocBlock](https://github.com/phpDocumentor/ReflectionDocBlock)

Changelog
---------

[](#changelog)

Refer to [Releases](https://github.com/phpowermove/docblock/releases)

###  Health Score

49

—

FairBetter than 95% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity59

Moderate usage in the ecosystem

Community22

Small or concentrated contributor base

Maturity76

Established project with proven stability

 Bus Factor1

Top contributor holds 56.5% 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 ~205 days

Recently: every ~54 days

Total

14

Last Release

1699d ago

Major Versions

v1.6 → v2.02020-04-09

v2.0.1 → v3.02021-03-03

v3.0.2 → v4.02021-09-22

PHP version history (4 changes)v1.0PHP &gt;=5.4

v1.6PHP &gt;=5.6

v2.0PHP &gt;=7.2

v3.0PHP &gt;=8.0

### Community

Maintainers

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

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

---

Top Contributors

[![gossi](https://avatars.githubusercontent.com/u/283700?v=4)](https://github.com/gossi "gossi (26 commits)")[![cristianoc72](https://avatars.githubusercontent.com/u/865437?v=4)](https://github.com/cristianoc72 "cristianoc72 (16 commits)")[![digitalkaoz](https://avatars.githubusercontent.com/u/293591?v=4)](https://github.com/digitalkaoz "digitalkaoz (3 commits)")[![mb-joker](https://avatars.githubusercontent.com/u/16693632?v=4)](https://github.com/mb-joker "mb-joker (1 commits)")

---

Tags

docblockparsergeneratordocblock

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/phpowermove-docblock/health.svg)

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

###  Alternatives

[doctrine/lexer

PHP Doctrine Lexer parser library that can be used in Top-Down, Recursive Descent Parsers.

11.2k910.8M118](/packages/doctrine-lexer)[jan-swiecki/simple-annotations

Simple annotation parser

66615.0k18](/packages/jan-swiecki-simple-annotations)[gajus/paggern

Pattern interpreter for generating random strings.

3045.1k1](/packages/gajus-paggern)[dannykopping/docblock

A simple library for parsing PHP DocBlock comments

191.8k2](/packages/dannykopping-docblock)

PHPackages © 2026

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