PHPackages                             sphpdox/sphpdox - 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. sphpdox/sphpdox

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

sphpdox/sphpdox
===============

PHPDoc to Sphinx phpdomain tool

v1.0(10y ago)4817.2k16[7 issues](https://github.com/varspool/sphpdox/issues)7GPL-3.0+PHPPHP &gt;=5.5.9CI failing

Since Dec 15Pushed 6y ago10 watchersCompare

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

READMEChangelog (1)Dependencies (4)Versions (2)Used By (7)

Sphpdox
=======

[](#sphpdox)

PHPDoc to Sphinx phpdomain
--------------------------

[](#phpdoc-to-sphinx-phpdomain)

Writing ReStructuredText documentation for your PHP project? Already have well documented PHP code using docblocks? Use this to generate API documentation compatible with Sphinx's [sphinxcontrib-phpdomain](http://packages.python.org/sphinxcontrib-phpdomain/).

The name is a mixture of 'sphinx' and 'phpdoc'.

### Installing

[](#installing)

Compatible with PSR-0. The vendor namespace is **Sphpdox**.

#### composer

[](#composer)

Sphpdox is available on Packagist as `sphpdox/sphpdox`.

```
    {
        ...
        "require": {
            "sphpdox/sphpdox": "dev-master"
        }
    }
```

### What It Does

[](#what-it-does)

Sphpdox reads a directory of your namespaced source code. It finds documented classes, methods, properties, etc. and produces documentation in ReStructuredText format, using the `phpdomain` available as part of `sphinxcontrib`. It takes a library like this:

```
lib
├── SplClassLoader.php
└── Wrench
    ├── Application
    │   ├── Application.php
    │   └── EchoApplication.php
    ├── BasicServer.php
    ├── Client.php
    ├── ConnectionManager.php
    ├── Connection.php
    ├── Frame
    │   ├── Frame.php
    │   └── HybiFrame.php
    ├── Listener
    │   ├── HandshakeRequestListener.php
    │   ├── Listener.php
    │   ├── OriginPolicy.php
    │   └── RateLimiter.php
    ├── Payload
    │   ├── HybiPayload.php
    │   └── Payload.php
    ├── Protocol
    │   ├── Hybi10Protocol.php
    │   ├── HybiProtocol.php
    │   ├── Protocol.php
    │   └── Rfc6455Protocol.php
    ├── Resource.php
    ├── Server.php
    ├── Socket
    │   ├── ClientSocket.php
    │   ├── ServerClientSocket.php
    │   ├── ServerSocket.php
    │   ├── Socket.php
    │   └── UriSocket.php
    └── Util
        ├── Configurable.php
        └── Ssl.php

```

And turns it into a documentation tree, like this:

```
build/Wrench/
├── Application
│   ├── Application.rst
│   ├── EchoApplication.rst
│   └── index.rst
├── BasicServer.rst
├── Client.rst
├── ConnectionManager.rst
├── Connection.rst
├── Frame
│   ├── Frame.rst
│   ├── HybiFrame.rst
│   └── index.rst
├── index.rst
├── Listener
│   ├── HandshakeRequestListener.rst
│   ├── index.rst
│   ├── Listener.rst
│   ├── OriginPolicy.rst
│   └── RateLimiter.rst
├── Payload
│   ├── HybiPayload.rst
│   ├── index.rst
│   └── Payload.rst
├── Protocol
│   ├── Hybi10Protocol.rst
│   ├── HybiProtocol.rst
│   ├── index.rst
│   ├── Protocol.rst
│   └── Rfc6455Protocol.rst
├── Resource.rst
├── Server.rst
├── Socket
│   ├── ClientSocket.rst
│   ├── index.rst
│   ├── ServerClientSocket.rst
│   ├── ServerSocket.rst
│   ├── Socket.rst
│   └── UriSocket.rst
└── Util
    ├── Configurable.rst
    ├── index.rst
    └── Ssl.rst

```

Where each file contains documentation for a class, like this:

```
.. php:class:: DateTime

  Datetime class

  .. php:method:: setDate($year, $month, $day)

      Set the date.

      :param int $year: The year.
      :param int $month: The month.
      :param int $day: The day.
      :returns: Either false on failure, or the datetime object for method chaining.

  .. php:method:: setTime($hour, $minute[, $second])

      Set the time.

      :param int $hour: The hour
      :param int $minute: The minute
      :param int $second: The second
      :returns: Either false on failure, or the datetime object for method chaining.

  .. php:const:: ATOM

      Y-m-d\TH:i:sP
```

### Usage

[](#usage)

`./sphpdox.php help` for help. The main command is `process`. If you don't supply any arguments, you'll be asked interactively.

Here's the built-in help for the `process` command:

```
$./sphpdox.php help process
Usage:
 process [-o|--output="..."] [-t|--title="..."] [-x|--exclude="..."] namespace path

Arguments:
 namespace      The namespace to process
 path           The path the namespace can be found in

Options:
 --output (-o)  The path to output the ReST files (default: build)
 --title (-t)   An alternate title for the top level namespace
 --exclude (-x) Semicolon separated namespaces to ignore

Help:
 The process command works recursively on a directory of PHP code.

```

### Libraries

[](#libraries)

Sphpdox uses the Symfony Console component, and PHP-Token-Reflection. I strongly recommend you use composer to install sphpdox, to avoid hunting down dependencies.

### License

[](#license)

sphpdox is released under GPL-3.0+

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance17

Infrequent updates — may be unmaintained

Popularity38

Limited adoption so far

Community28

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

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

Unknown

Total

1

Last Release

3799d ago

### Community

Maintainers

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

---

Top Contributors

[![dominics](https://avatars.githubusercontent.com/u/97427?v=4)](https://github.com/dominics "dominics (21 commits)")[![victorhaggqvist](https://avatars.githubusercontent.com/u/1887628?v=4)](https://github.com/victorhaggqvist "victorhaggqvist (9 commits)")[![bd808](https://avatars.githubusercontent.com/u/6469?v=4)](https://github.com/bd808 "bd808 (5 commits)")[![sabbelasichon](https://avatars.githubusercontent.com/u/13050560?v=4)](https://github.com/sabbelasichon "sabbelasichon (4 commits)")[![jurgenf](https://avatars.githubusercontent.com/u/111112?v=4)](https://github.com/jurgenf "jurgenf (2 commits)")[![edrush](https://avatars.githubusercontent.com/u/4974858?v=4)](https://github.com/edrush "edrush (1 commits)")[![deceze](https://avatars.githubusercontent.com/u/137217?v=4)](https://github.com/deceze "deceze (1 commits)")

---

Tags

phpdocdocumentationsphinxrst

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[symplify/monorepo-builder

Not only Composer tools to build a Monorepo.

5205.3M82](/packages/symplify-monorepo-builder)[shlinkio/shlink

A self-hosted and PHP-based URL shortener application with CLI and REST interfaces

4.8k4.3k](/packages/shlinkio-shlink)[shivas/versioning-bundle

Symfony application versioning, simple console command to manage version (with providers e.g. git tag) of your application using Semantic Versioning 2.0.0 recommendations

1121.2M1](/packages/shivas-versioning-bundle)[overtrue/php-opencc

中文简繁转换，支持词汇级别的转换、异体字转换和地区习惯用词转换（中国大陆、台湾、香港、日本新字体）。基于 \[BYVoid/OpenCC\](https://github.com/BYVoid/OpenCC) 数据实现。

12130.7k](/packages/overtrue-php-opencc)[shyim/danger-php

Port of danger to PHP

8544.9k](/packages/shyim-danger-php)[codelicia/xulieta

Xulieta is a light php binary that lint documentation snippets

6713.3k5](/packages/codelicia-xulieta)

PHPackages © 2026

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