PHPackages                             apigen/apigen - 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. [API Development](/categories/api)
4. /
5. apigen/apigen

ActiveLibrary[API Development](/categories/api)

apigen/apigen
=============

PHP source code API generator.

v4.1.2(10y ago)2.2k627.9k↓25.6%308[18 issues](https://github.com/apigen/apigen/issues)[3 PRs](https://github.com/apigen/apigen/pulls)20MITPHPPHP &gt;=5.4CI passing

Since Sep 29Pushed 1y ago101 watchersCompare

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

READMEChangelog (10)Dependencies (21)Versions (26)Used By (20)

Smart and Readable Documentation for PHP projects
=================================================

[](#smart-and-readable-documentation-for-php-projects)

ApiGen is easy to use and modern API doc generator **supporting all PHP 8.3 features**.

Features
--------

[](#features)

- phpDoc
    - [all types supported by PHPStan](https://phpstan.org/writing-php-code/phpdoc-types)
    - [generic class declarations](https://phpstan.org/blog/generics-in-php-using-phpdocs)
    - [local type aliases](https://phpstan.org/writing-php-code/phpdoc-types#local-type-aliases)
- PHP 8.3
    - [typed class constants](https://wiki.php.net/rfc/typed_class_constants)
- PHP 8.2
    - [constants in traits](https://wiki.php.net/rfc/constants_in_traits)
    - [fetch enum properties in const expressions](https://wiki.php.net/rfc/fetch_property_in_const_expressions)
    - [disjunctive normal form types](https://wiki.php.net/rfc/dnf_types)
    - [readonly classes](https://wiki.php.net/rfc/readonly_classes)
    - [true](https://wiki.php.net/rfc/true-type), [false and null types](https://wiki.php.net/rfc/null-false-standalone-types)
- PHP 8.1
    - [enums](https://wiki.php.net/rfc/enumerations)
    - [pure intersection types](https://wiki.php.net/rfc/pure-intersection-types)
    - [never type](https://wiki.php.net/rfc/noreturn_type)
    - [final class constants](https://wiki.php.net/rfc/final_class_const)
    - [new in initializers](https://wiki.php.net/rfc/new_in_initializers)
    - [readonly properties](https://wiki.php.net/rfc/readonly_properties_v2)
- PHP 8.0
    - [constructor property promotion](https://wiki.php.net/rfc/constructor_promotion)
    - [union types](https://wiki.php.net/rfc/union_types_v2)
    - [mixed type](https://wiki.php.net/rfc/mixed_type_v2)
    - [static return type](https://wiki.php.net/rfc/static_return_type)
- PHP 7.4
    - [typed properties](https://wiki.php.net/rfc/typed_properties_v2)
- PHP 7.2
    - [object type](https://wiki.php.net/rfc/object-typehint)
- PHP 7.1
    - [nullable types](https://wiki.php.net/rfc/nullable_types)
    - [iterable type](https://wiki.php.net/rfc/iterable)
    - [void type](https://wiki.php.net/rfc/void_return_type)
    - [class constant visibility](https://wiki.php.net/rfc/class_const_visibility)
- PHP 7.0
    - [scalar types](https://wiki.php.net/rfc/scalar_type_hints_v5)
    - [return types](https://wiki.php.net/rfc/return_types)
- PHP 5.6
    - [constant scalar expressions](https://wiki.php.net/rfc/const_scalar_exprs)
    - [variadic functions](https://wiki.php.net/rfc/variadics)
- PHP 5.4
    - [traits](https://wiki.php.net/rfc/horizontalreuse)
    - [callable type](https://wiki.php.net/rfc/callable)
    - [binary integer notation](https://wiki.php.net/rfc/binnotation4ints)

Built on Shoulders of Giants
----------------------------

[](#built-on-shoulders-of-giants)

- [nikic/php-parser](https://github.com/nikic/PHP-Parser)
- [phpstan/phpdoc-parser](https://github.com/phpstan/phpdoc-parser)
- [latte/latte](https://github.com/nette/latte)
- [league/commonmark](https://github.com/thephpleague/commonmark)

Install
-------

[](#install)

### With Docker

[](#with-docker)

ApiGen is available as [apigen/apigen](https://hub.docker.com/r/apigen/apigen) Docker image which you can directly use.

```
docker run --rm --interactive --tty --volume "$PWD:$PWD" --workdir "$PWD" \
  apigen/apigen:edge \
  src --output docs
```

### With Phar

[](#with-phar)

This will install ApiGen phar binary to `tools/apigen`.

```
mkdir -p tools
curl -L https://github.com/ApiGen/ApiGen/releases/latest/download/apigen.phar -o tools/apigen
chmod +x tools/apigen
tools/apigen src --output docs
```

### With Composer

[](#with-composer)

This will install ApiGen to `tools/apigen` directory with executable entry point available in `tools/apigen/bin/apigen`.

```
composer create-project --no-dev apigen/apigen:^7.0@alpha tools/apigen
tools/apigen/bin/apigen src --output docs
```

Usage
-----

[](#usage)

Generate API docs by passing source directories and destination option:

```
apigen src --output docs
```

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

[](#configuration)

ApiGen can be configured with `apigen.neon` configuration file.

```
parameters:
  # string[], passed as arguments in CLI, e.g. ['src']
  paths: []

  # string[], --include in CLI, included files mask, e.g. ['*.php']
  include: ['*.php']

  # string[], --exclude in CLI, excluded files mask, e.g. ['tests/**']
  exclude: []

  # bool, should protected members be excluded?
  excludeProtected: false

  # bool, should private members be excluded?
  excludePrivate: true

  # string[], list of tags used for excluding class-likes and members
  excludeTagged: ['internal']

  # string, --output in CLI
  outputDir: '%workingDir%/api'

  # string | null, --theme in CLI
  themeDir: null

  # string, --title in CLI
  title: 'API Documentation'

  # string, --base-url in CLI
  baseUrl: ''

  # int, --workers in CLI, number of processes that will be forked for parallel rendering
  workerCount: 8

  # string, --memory-limit in CLI
  memoryLimit: '512M'
```

###  Health Score

55

—

FairBetter than 98% of packages

Maintenance33

Infrequent updates — may be unmaintained

Popularity62

Solid adoption and visibility

Community55

Growing community involvement

Maturity68

Established project with proven stability

 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

Every ~174 days

Recently: every ~55 days

Total

23

Last Release

1137d ago

Major Versions

v2.8.1 → v4.0.0-RC12014-10-02

v4.1.2 → v5.0.0-RC12017-06-17

v5.0.0-RC5 → v7.0.0-alpha2022-07-10

PHP version history (5 changes)2.8.0PHP &gt;=5.3.0

v4.0.0-RC1PHP &gt;=5.3.1

v4.0.0-RC5PHP &gt;=5.4

v5.0.0-RC1PHP ^7.1

v7.0.0-alphaPHP ^8.1

### Community

Maintainers

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

---

Top Contributors

[![TomasVotruba](https://avatars.githubusercontent.com/u/924196?v=4)](https://github.com/TomasVotruba "TomasVotruba (977 commits)")[![kukulich](https://avatars.githubusercontent.com/u/260445?v=4)](https://github.com/kukulich "kukulich (775 commits)")[![JanTvrdik](https://avatars.githubusercontent.com/u/175109?v=4)](https://github.com/JanTvrdik "JanTvrdik (530 commits)")[![Andrewsville](https://avatars.githubusercontent.com/u/506715?v=4)](https://github.com/Andrewsville "Andrewsville (347 commits)")[![ek9](https://avatars.githubusercontent.com/u/17393048?v=4)](https://github.com/ek9 "ek9 (86 commits)")[![jadb](https://avatars.githubusercontent.com/u/33527?v=4)](https://github.com/jadb "jadb (76 commits)")[![vlastavesely](https://avatars.githubusercontent.com/u/22521379?v=4)](https://github.com/vlastavesely "vlastavesely (68 commits)")[![dg](https://avatars.githubusercontent.com/u/194960?v=4)](https://github.com/dg "dg (50 commits)")[![jankal](https://avatars.githubusercontent.com/u/6324332?v=4)](https://github.com/jankal "jankal (23 commits)")[![POPSuL](https://avatars.githubusercontent.com/u/683358?v=4)](https://github.com/POPSuL "POPSuL (21 commits)")[![milo](https://avatars.githubusercontent.com/u/439140?v=4)](https://github.com/milo "milo (20 commits)")[![FlTr](https://avatars.githubusercontent.com/u/9076372?v=4)](https://github.com/FlTr "FlTr (7 commits)")[![nelson6e65](https://avatars.githubusercontent.com/u/9272498?v=4)](https://github.com/nelson6e65 "nelson6e65 (5 commits)")[![phillaf](https://avatars.githubusercontent.com/u/1533572?v=4)](https://github.com/phillaf "phillaf (4 commits)")[![markstory](https://avatars.githubusercontent.com/u/24086?v=4)](https://github.com/markstory "markstory (3 commits)")[![Majkl578](https://avatars.githubusercontent.com/u/144181?v=4)](https://github.com/Majkl578 "Majkl578 (3 commits)")[![jrnickell](https://avatars.githubusercontent.com/u/947805?v=4)](https://github.com/jrnickell "jrnickell (3 commits)")[![yoosefi](https://avatars.githubusercontent.com/u/2010434?v=4)](https://github.com/yoosefi "yoosefi (3 commits)")[![grogy](https://avatars.githubusercontent.com/u/1322983?v=4)](https://github.com/grogy "grogy (3 commits)")[![olvlvl](https://avatars.githubusercontent.com/u/155998?v=4)](https://github.com/olvlvl "olvlvl (3 commits)")

---

Tags

apidocapigendocumentationgeneratorphpphp71apiphpdocdocumentationgenerator

### Embed Badge

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

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

###  Alternatives

[phpdocumentor/phpdocumentor

Documentation Generator for PHP

4.4k3.1M878](/packages/phpdocumentor-phpdocumentor)[darkaonline/l5-swagger

OpenApi or Swagger integration to Laravel

2.9k34.0M112](/packages/darkaonline-l5-swagger)[knuckleswtf/scribe

Generate API documentation for humans from your Laravel codebase.✍

2.3k12.2M45](/packages/knuckleswtf-scribe)[tomaj/nette-api

Nette api

36261.8k4](/packages/tomaj-nette-api)[crada/php-apidoc

Generate documentation for php API based application. No dependency. No framework required.

259206.9k2](/packages/crada-php-apidoc)[code-lts/doctum

Doctum, a PHP API documentation generator. Fork of Sami

35077.9k31](/packages/code-lts-doctum)

PHPackages © 2026

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