PHPackages                             8fold/php-documenter - 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. 8fold/php-documenter

AbandonedArchivedLibrary

8fold/php-documenter
====================

A standalone library that wraps phpDocumentor for use with frameworks supporting PHP packages.

00PHP

Since May 23Pushed 4y ago1 watchersCompare

[ Source](https://github.com/8fold/php-documenter)[ Packagist](https://packagist.org/packages/8fold/php-documenter)[ RSS](/packages/8fold-php-documenter/feed)WikiDiscussions main Synced 3d ago

READMEChangelogDependenciesVersions (1)Used By (0)

Documenter for Php by 8fold
===========================

[](#documenter-for-php-by-8fold)

- [Setting up](#setup)
- [Initializing](#initializing)
- [Elements, objects, and symbols](#definitions)
- [DocBlocks](#docblocks)
- [Routes](#routes)
- [Performance](#performance)

Documenter is a library (more of an extension or wrapper) based on [phpDocumentor](https://www.phpdoc.org), which, as of this writing, is the more popular base library for interacting with inline documentation for PHP projects.

There are a multitude of generators available for creating documentation sites for PHP projects. Many of those generate static sites (HTML or other files) for presenting on the web. This makes sense for two primary reasons:

1. content is static (the project's PHP files don't typically change once captured) and
2. performance (large projects can contain hundreds or even throusands of files).

However, when examining projects at 8fold (and a few others), we found these two considerations no longer carrying the weight they once would have. As PHP projects become more modular, the number of files to capture documentation for is becoming less and less. Further, PHP and its related Zend Framework are actually pretty fast. Finally, various modern development techniques can also reduce the load put on the server to generate the documentation. (See [Performance section](#performance) for more details.)

At 8fold, we also found limitations with the static site generators, which inspired us to try something different.

Add Documenter to a PHP project and deliver the documentation via web-based APIs. Add Documenter to a dynamic site and integrate it seemlessly (no need to switch from dynamic content delivery to static content delivery). Change your return strings or template files without having to do anything else to update all project versions to the new look and feel.

Setting up
----------

[](#setting-up)

```
$ composer require 8fold/documenter-php
```

Or add the following to the require portion of your composer file and run `composer install` or `composer update`:

```
"8fold/documenter-php": "*"
```

Recommend adding this to your PSR-4 declaration:

```
"Eightfold\\DocumenterPhp\\": "vendor/8fold/documenter-php/src/"
```

Documenter also uses the following:

- [Html5Gen](https://github.com/8fold/html5-generator-php)
- [phpDocumentor Reflection](https://github.com/phpDocumentor/Reflection)
- [The PHP League's CommonMark](https://github.com/thephpleague/commonmark)

Initializing
------------

[](#initializing)

The main entry class for Documenter is, well, the Documenter class found in `/src`; see [documentation](https://github.com/8fold/documenter-php/blob/develop/src/Documenter.php#L27) what information is required. Once initialized, you should be able to traverse things pretty easily. (In relative terms.)

If at any point you get stuck, please either update the documentatin, or let us know, and we will do our best to improve the experience.

Elements, Objects, and Symbols
------------------------------

[](#elements-objects-and-symbols)

- **Element:** A piece of code that can have associated DocBlock.
- **Object:** An *element* with an independent scope.
- **Symbol:** An *element* with a dependent scope.

For example, the following are all "objects":

```
