2017 © Pedro Pelรกez
 

library sphpdox

PHPDoc to Sphinx phpdomain tool

image

sphpdox/sphpdox

PHPDoc to Sphinx phpdomain tool

  • Saturday, July 21, 2018
  • by dominics
  • Repository
  • 10 Watchers
  • 43 Stars
  • 4,110 Installations
  • PHP
  • 11 Dependents
  • 1 Suggesters
  • 16 Forks
  • 7 Open issues
  • 4 Versions
  • 6 % Grown

The README.md

Sphpdox

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., (*1)

The name is a mixture of 'sphinx' and 'phpdoc'., (*2)

Installing

Compatible with PSR-0. The vendor namespace is Sphpdox., (*3)

composer

Sphpdox is available on Packagist as sphpdox/sphpdox., (*4)

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

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:, (*5)

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:, (*6)

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:, (*7)

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

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

Here's the built-in help for the process command:, (*9)

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

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

License

sphpdox is released under GPL-3.0+, (*11)

The Versions

21/07 2018

dev-task/remove-composer-lock-file

dev-task/remove-composer-lock-file http://github.com/varspool/sphpdox

PHPDoc to Sphinx phpdomain tool

  Sources   Download

GPL-3.0+

The Requires

 

The Development Requires

documentation phpdoc sphinx rst

21/07 2018

dev-master

9999999-dev http://github.com/varspool/sphpdox

PHPDoc to Sphinx phpdomain tool

  Sources   Download

GPL-3.0+

The Requires

 

The Development Requires

documentation phpdoc sphinx rst

21/07 2018

dev-task/modernize-dependencies

dev-task/modernize-dependencies http://github.com/varspool/sphpdox

PHPDoc to Sphinx phpdomain tool

  Sources   Download

GPL-3.0+

The Requires

 

The Development Requires

documentation phpdoc sphinx rst

15/12 2015

v1.0

1.0.0.0 http://github.com/varspool/sphpdox

PHPDoc to Sphinx phpdomain tool

  Sources   Download

GPL-3.0+

The Requires

 

The Development Requires

documentation phpdoc sphinx rst