PHPackages                             sinefineinfinitum/ponymator - 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. sinefineinfinitum/ponymator

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

sinefineinfinitum/ponymator
===========================

Ponymator - generate docs for php project

v1.0.1(1mo ago)00[1 PRs](https://github.com/sinefineinfinitum/ponymator/pulls)MITPHPPHP ^8.0CI passing

Since May 30Pushed 1mo agoCompare

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

READMEChangelogDependencies (4)Versions (10)Used By (0)

Ponymator
=========

[](#ponymator)

[![Packagist Version](https://camo.githubusercontent.com/2ecad571313f6bb5cb8d4652013d3faeb7ec48f441fb11aec92be6edc13f2650/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f73696e6566696e65696e66696e6974756d2f706f6e796d61746f72)](https://packagist.org/packages/sinefineinfinitum/ponymator)[![PHP Version](https://camo.githubusercontent.com/3ce253cf610a6659a07e7962dadb2f06d685ca236d1d7286db4c797a1ca2b595/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e302b2d707572706c65)](https://packagist.org/packages/sinefineinfinitum/ponymator)[![License](https://camo.githubusercontent.com/3109b6a288f53fb398de4113d31844b666c55d431ff8287a4df1f66961885cc4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f73696e6566696e65696e66696e6974756d2f706f6e796d61746f72)](https://packagist.org/packages/sinefineinfinitum/ponymator)[![CI](https://camo.githubusercontent.com/1ae8b8a1a52889db44b0adcf564487c9086c0f4ff81e3579b7bb0dc060e43370/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f73696e6566696e65696e66696e6974756d2f706f6e796d61746f722f63692e796d6c3f6272616e63683d6d61696e)](https://github.com/sinefineinfinitum/ponymator/actions)[![PHPStan level](https://camo.githubusercontent.com/17f9c96de70e616ad864f0f6e2863ab37cabfa73b085ed6a2fcdc2c8dddd42a3/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048505374616e2d382d627269676874677265656e)](https://github.com/phpstan/phpstan)[![Mutation Score](https://camo.githubusercontent.com/def86b7eefa0f6dce8fa36ee9cca4a5b192cc5aaa993a37d429df10f9af515d3/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4d53492d37312532352d79656c6c6f77)](https://github.com/sinefineinfinitum/ponymator/actions)

A CLI-first PHP documentation generator that produces deterministic Markdown documentation for a project's API surface.

Principles
----------

[](#principles)

### AST-First Correctness

[](#ast-first-correctness)

Ponymator uses PHP Abstract Syntax Tree analysis (via [`nikic/php-parser`](https://github.com/nikic/PHP-Parser)) as the single source of truth. API extraction — classes, interfaces, traits, enums, constants, properties, methods, signatures, inheritance, implemented interfaces, modifiers, and dependencies — is derived from parsed PHP source code, never from regex or string matching. If source code cannot be parsed, the tool fails with actionable diagnostics.

### Deterministic Output

[](#deterministic-output)

For identical source code and configuration, repeated runs produce byte-identical Markdown files. Ordering of classes, methods, dependencies, imports, modifiers, and sections is fully deterministic, making output suitable for CI comparison.

### CLI-First Experience

[](#cli-first-experience)

ModeFlagDescriptionFull`generate --full`Regenerate all documentationDiff`generate --diff`Regenerate only changed files (default)Graph`graph import`Import PHP analysis into graph databaseShow`show entity`Analyze entity dependencies and impactExit codes:

CodeMeaning`0`Success`1`Generic error (parsing, runtime)`2`Command-line syntax error (unknown flag/command)`64`Wrong usage (invalid arguments)`65`Data error (database, entity not found)`66`Source not found`73`Output file/directory error`78`Config file missing, unreadable, or malformed### Test-First Quality

[](#test-first-quality)

Every behavior affecting documentation, CLI contracts, configuration, parsing, or exit codes is covered by PHPUnit tests. Required coverage: AST parsing, Markdown format, config validation, full generation, incremental diff, error handling.

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

[](#installation)

```
composer require sinefineinfinitum/ponymator
```

Usage
-----

[](#usage)

```
# Main help
vendor/bin/ponymator --help

# Generate documentation
vendor/bin/ponymator generate [--full | --diff] [--config=] [--output=md|psv1]

# Manage graph database
vendor/bin/ponymator graph import [--db-path=]
vendor/bin/ponymator graph clear

# Analyze entities
vendor/bin/ponymator show entity  [--depth=N]
vendor/bin/ponymator show impact  [--depth=N]
vendor/bin/ponymator show path
```

### Commands

[](#commands)

#### `generate`

[](#generate)

Produces documentation from PHP source code.

- `--full`: Force regeneration of all files.
- `--diff`: Only update files that changed since last run (default).
- `--output=md`: (Default) Standard Markdown output.
- `--output=psv1`: [Ponymator Syntax v1](spec-ps-v1.md) (compact, machine-readable format for graph analysis).

#### `graph`

[](#graph)

Handles the SQLite graph database used for deep dependency analysis.

- `import`: Scans source code, parses AST, and populates the graph database with entities and relationships.
- `clear`: Drops all tables and recreates the schema in the graph database. Useful for a fresh start or fixing corruption.

#### `show`

[](#show)

Interactive analysis of the dependency graph. Supports FQCN or short names (if unique).

- `entity `: Shows detailed info about an entity (class, method, etc.) and its direct outgoing dependencies (structural and calls).
- `impact `: Performs reverse dependency analysis. Lists all entities that depend on the target, recursively up to `--depth`.
- `path  `: Finds the shortest path between two entities. Analyzes both forward (depends on) and reverse (is used by) relationships to show how two parts of the system are connected.
- `--depth=N`: Limits recursion depth for `impact` command (default: 3).
- `--db-path=`: Override the database path from config.

Generated Documentation Example
-------------------------------

[](#generated-documentation-example)

The generated Markdown includes YAML frontmatter with a content hash and type, followed by a summary of the entity:

```
---
type: class
hash: 3d8f1b2c9a0e
---

# `App\Service\UserService`

`final class` extends `App\Abstracts\BaseService` implements `App\Contracts\ServiceInterface`

## Constants

| Constant | Visibility | Type | Value |
| :------- | :--------- | :--- | :---- |
| `MAX_RETRIES` | public | int | `3` |

## Properties

- `public string $name`
- `protected ?int $cacheTtl = null`

## Methods

- `public static function create(``string`` $name``, ``array`` $data = []``): ``App\Models\User`
  - **Creates:**
    - [App\Models\User](../Models/User.md)
  - **Calls:**
    - `strong` `App\Service\Logger::log`
    - `strong` [App\Models\User](../Models/User.md)->save
    - `weak` `handleException`

## Used by

- [App\Contract\ServiceInterface](..\Contract\ServiceInterface.md)
- `Vendor\Package\SomeClass`
```

### Markdown Call Graph &amp; Object Creation Rules

[](#markdown-call-graph--object-creation-rules)

1. **Method-Nested Structure**: No global `Creates` or `Call Graph` sections. Object creations (`Creates`) and method calls (`Calls`) are nested directly under their respective method signature.
2. **Human-Readable Association**: Compact symbols (`*`, `?`) are replaced with explicit labels: ``strong`` or ``weak``.
3. **No Unknown Targets**: `Unknown` targets are excluded. Unresolved calls list only the called name (labeled ``weak``).
4. **Call Operator Notation**: Type of call is implied by PHP syntax instead of text tags:
    - Static: `Class::method`
    - Dynamic: `Class->method`
5. **No Duplication**: Instantiations via `new` are listed only under `Creates` and excluded from `Calls`.

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

[](#requirements)

- PHP ^8.0
- ext-json (usually built-in)

Development
-----------

[](#development)

```
composer install
vendor/bin/phpunit
vendor/bin/phpstan analyse
vendor/bin/phpcs
```

Architecture
------------

[](#architecture)

```
src/
├── Analyzer/               # AST parsing, entity & dependency extraction
│   ├── Extractor/          #  — class, interface, trait, enum extractors
│   ├── Linker/             #  — cross-reference index builder
│   ├── Visitor/            #  — AST visitors (entities, deps, creations)
├── Cli/                    # Argument parsing
├── Comparator/             # Hash-based file comparison
├── Documentation/          # Generation, cross-linking, rendering, cleanup
│   ├── Cleaner/            #  — outdated doc removal
│   ├── Linker/             #  — cross-reference resolution
│   ├── Processor/          #  — page generation orchestration
│   └── Renderer/           #  — per-entity Markdown renderers
├── Filesystem/             # Path resolution, file scanning
├── Config.php              # Configuration loading & validation
└── Ponymator.php           # Main orchestrator

```

Configuration
-------------

[](#configuration)

Configuration file: `.ponymator.json`. Example:

```
{
    "source": "app",
    "target": "api-docs",
    "ignore": ["vendor", "node_modules"],
    "dbPath": "./db/path"
}
```

License
-------

[](#license)

MIT

###  Health Score

37

—

LowBetter than 81% of packages

Maintenance92

Actively maintained with recent releases

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~1 days

Total

3

Last Release

52d ago

Major Versions

v0.0.1 → v1.0.02026-06-01

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/183192350?v=4)[sinefineinfinitum](/maintainers/sinefineinfinitum)[@sinefineinfinitum](https://github.com/sinefineinfinitum)

---

Top Contributors

[![sinefineinfinitum](https://avatars.githubusercontent.com/u/183192350?v=4)](https://github.com/sinefineinfinitum "sinefineinfinitum (64 commits)")

---

Tags

analysisdocs

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3345.3M347](/packages/psalm-plugin-laravel)[boundwize/structarmed

Configurable PHP architecture guards — define your layers and rules, then keep them enforced

45629.2k26](/packages/boundwize-structarmed)[tempest/framework

The PHP framework that gets out of your way.

2.2k34.4k16](/packages/tempest-framework)[v.chetkov/php-clean-architecture

PHP Clean Architecture

14661.3k](/packages/vchetkov-php-clean-architecture)[brianhenryie/strauss

Prefixes dependencies namespaces so they are unique to your plugin

192438.1k39](/packages/brianhenryie-strauss)[typo3/cms-install

TYPO3 CMS Install Tool - The Install Tool is used for installation, upgrade, system administration and setup tasks.

1812.3M509](/packages/typo3-cms-install)

PHPackages © 2026

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