PHPackages                             steveolotu/featuredocu - 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. steveolotu/featuredocu

ActiveSymfony-bundle[Utility &amp; Helpers](/categories/utility)

steveolotu/featuredocu
======================

Uses annotations to auto-generate documentation of business logic features in the code.

21.3k1[1 issues](https://github.com/steveolotu/featuredocu/issues)PHP

Since Jan 31Pushed 5y ago1 watchersCompare

[ Source](https://github.com/steveolotu/featuredocu)[ Packagist](https://packagist.org/packages/steveolotu/featuredocu)[ RSS](/packages/steveolotu-featuredocu/feed)WikiDiscussions main Synced 3w ago

READMEChangelogDependenciesVersions (1)Used By (0)

Feature Docu
============

[](#feature-docu)

Disclaimer / Warning
--------------------

[](#disclaimer--warning)

This is still work in progress. The code already works (in a different context), but I'm new to the dependency publishing game. So I'm still trying to figure stuff out and had to publish it first, in order to test it.

Table of Contents
-----------------

[](#table-of-contents)

1. [Introduction](#introduction)
    1. [Problem 1: Spread out features](#problem-1-spread-out-features)
    2. [Problem 2: Rotting or neglected documentation](#problem-2-rotting-or-neglected-documentation)
    3. [Solution](#solution)
2. [Requirements](#requirements)
3. [Installation](#installation)
    1. [Step 1: Install the bundle using composer](#step-1-install-the-bundle-using-composer)
    2. [Step 2: Add the bundle to your bundles.php](#step-2-add-the-bundle-to-your-bundlesphp)
    3. [(Optional) Register Twig template](#optional-register-twig-template)
4. [Usage](#usage)
    1. [Adding references](#adding-references)
    2. [Using references](#using-references)
        1. [Output references](#output-references)
        2. [Output a "table of contents"-list of identifiers](#output-a-table-of-contents-list-of-identifiers)
        3. [Internally used output formats](#internally-used-output-formats)
5. [TODO](#todo)
6. [Contributors](#contributors)

Introduction
------------

[](#introduction)

This bundle auto-generates documentation from specific annotations.

### Problem 1: Spread out features

[](#problem-1-spread-out-features)

The truth is in the code, sure, but the code is oftentimes spread out across many files and folders. One business logic feature can be based on various different areas in the code. This is especially problematic if code is used, which is difficult to trace, for example if a class, method or property is called dynamically and hence difficult to find via searching.

In these situations, the easiest way of understanding components is asking the architect to explain it. While doing so, they can just across different files and give brief comments on what happens where.

### Problem 2: Rotting or neglected documentation

[](#problem-2-rotting-or-neglected-documentation)

Documentation is work, usually associated with a context switch and oftentimes out of date. Also, without a good system, it's difficult to find the documentation for the area one is currently working on.

### Solution

[](#solution)

To solve these problems, this library uses annotations to auto-generate up-to-date documentation in an appealing format and present it all in one place. It is sourced from bits and pieces spread out across the code. The documentation happens where the code happens. This enables developers to let documentation become part of their coding work without switching context.

Requirements
------------

[](#requirements)

- Build for use in Symfony 5.2, compatibility with other software is uncertain.
- Requires that all analyzed PHP-files follow the PSR4 specification. Specifically, Specification 3.3 "The terminating class name corresponds to a file name ending in .php. The file name MUST match the case of the terminating class name." (See )

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

[](#installation)

### Step 1: Install the bundle using composer

[](#step-1-install-the-bundle-using-composer)

```
composer require steveolotu/featuredocu

```

### Step 2: Add the bundle to your bundles.php

[](#step-2-add-the-bundle-to-your-bundlesphp)

```
// config/bundles.php
return [
//..
SteveOlotu\FeatureDocu\FeatureDocuBundle::class => ['all' => true],
];
```

### (Optional) Register Twig template

[](#optional-register-twig-template)

To use the Twig template, the path needs to be registered first.

To do so, add the path to the file: `config/packages/twig.yaml`.

If the variable "paths" doesn't exist yet, create it, but also add the default\_path:

Before:

```
twig:
    ...
    default_path: '%kernel.project_dir%/templates'
    ...
```

After:

```
twig:
    ...
    default_path: '%kernel.project_dir%/templates'
    paths:
        - '%kernel.project_dir%/templates'
        - '%kernel.project_dir%/vendor/steveolotu/featuredocu/templates'
    ...
```

Usage
-----

[](#usage)

### Adding references

[](#adding-references)

Add one or more `@FeatureDocuAnnotation` annotations to any class, method or property.

Required parameters are:

- identifier: The name of the feature. It is recommended to use slashes to separate levels.
- order: Order in which entries of one specific identifier will be displayed. Must be unique. Tipp: Using steps of 100 allows to add elements later on without having to update all respective references.
- Description: Text that explains which part of the feature this specific class, method or property has.

Examples:

```
@FeatureDocuAnnotation(identifier="Backup/generate", order="1000", description="UI starting point")

@FeatureDocuAnnotation(identifier="Backup/delete", order="1040", description="UI starting point.")

```

### Using references

[](#using-references)

To generate output, three steps are required:

1. Initialize Object with your desired path

```
$featureDocu = new FeatureDocu($path, $reader, $twig);
```

2. Analyzing the output checks the files in the specified path

```
$featureDocu->analyze();
```

3. Generate output.

#### Output references

[](#output-references)

- Array

```
$featureDocu->getOutputArray();
```

Html: A html table

```
$featureDocu->getOutputHtml();
```

#### Output a "table of contents"-list of identifiers

[](#output-a-table-of-contents-list-of-identifiers)

Assume there are several references with the two identifiers `backup/create` and `backup/delete`.

- Array: List of features

The following code:

```
$featureDocu->getFeatureListNestedArray();
```

...will generate an array in the format:

```
['backup' => [
    ['create' => true],
    ['delete' => true],
]

```

Note: The value "true" is only a placeholder. The useful data is stored in the keys.

- Html: A hierarchically indented and numbered list

The following code:

```
$featureDocu->getFeatureListHtmlList();
```

...will generate a nested ``-HTML list:

```
1 backup
 1.1 create
 1.2 delete

```

Note: The lowest level entries (those which represent actual identifiers, here: `create` and `backup`) are links to the sections in the HTML reference table (which needs to be on the same page in order for the connection to work).

#### Internally used output formats

[](#internally-used-output-formats)

- ListListObject: The internal object used to gather the information.

```
$featureDocu->getListObject();
```

- To get all class objects found in files, after analyzing the code, use:

```
$featureDocu->getClasses();
```

TODO#
-----

[](#todo)

- Add some tests
- Requirements are uncertain, check
- Check code style
- Check for unused code

Contributors
------------

[](#contributors)

Special thanks to [eFrane](https://github.com/eFrane).

###  Health Score

19

—

LowBetter than 9% of packages

Maintenance10

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity31

Early-stage or recently created project

 Bus Factor1

Top contributor holds 85.7% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/59d8c1b7698ab5eae15e7e13c5935d42bfa85304737f18e81da73e1b2a8d6d7b?d=identicon)[steveolotu](/maintainers/steveolotu)

---

Top Contributors

[![steveolotu](https://avatars.githubusercontent.com/u/19762663?v=4)](https://github.com/steveolotu "steveolotu (12 commits)")[![eFrane](https://avatars.githubusercontent.com/u/237165?v=4)](https://github.com/eFrane "eFrane (2 commits)")

---

Tags

documentationdocumentation-generatordocumentation-tool

### Embed Badge

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

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

###  Alternatives

[outl1ne/nova-media-hub

A Laravel Nova tool for managing media.

4656.0k](/packages/outl1ne-nova-media-hub)

PHPackages © 2026

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