PHPackages                             davidfuhr/php-plantumlwriter - 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. davidfuhr/php-plantumlwriter

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

davidfuhr/php-plantumlwriter
============================

A tool to create PlantUML class diagrams from your PHP source.

1.6.0(10y ago)979.7k24[3 issues](https://github.com/davidfuhr/php-plantumlwriter/issues)[4 PRs](https://github.com/davidfuhr/php-plantumlwriter/pulls)BSD-3-ClausePHP

Since Jun 30Pushed 8y ago6 watchersCompare

[ Source](https://github.com/davidfuhr/php-plantumlwriter)[ Packagist](https://packagist.org/packages/davidfuhr/php-plantumlwriter)[ RSS](/packages/davidfuhr-php-plantumlwriter/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependencies (3)Versions (9)Used By (0)

php-plantumlwriter
==================

[](#php-plantumlwriter)

[![Build Status](https://camo.githubusercontent.com/650d7aad802c27656ff35834b0a0033224bfd8abd27c95d1812f5219308f0ddf/68747470733a2f2f7472617669732d63692e6f72672f6461766964667568722f7068702d706c616e74756d6c7772697465722e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/davidfuhr/php-plantumlwriter) [![Scrutinizer Code Quality](https://camo.githubusercontent.com/a86394b81f25dfaaf003cbf6a70027d09b97e1d6f43e92a13327efc0e298ab79/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6461766964667568722f7068702d706c616e74756d6c7772697465722f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/davidfuhr/php-plantumlwriter/?branch=master) [![SensioLabsInsight](https://camo.githubusercontent.com/a60db7273baeb1a89ab89f8aa7850d2fa9602d989728ade89b2e1dd895df8a68/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f65633531666438642d363530352d343565632d616634312d3763623730636531643839632f6d696e692e706e67)](https://insight.sensiolabs.com/projects/ec51fd8d-6505-45ec-af41-7cb70ce1d89c) [![License](https://camo.githubusercontent.com/261bca50de089ffca8fd015bfd63451337e79d5335808fb28fb41c4fda4012d2/68747470733a2f2f706f7365722e707567782e6f72672f6461766964667568722f7068702d706c616e74756d6c7772697465722f6c6963656e73652e737667)](https://packagist.org/packages/davidfuhr/php-plantumlwriter)

Description
-----------

[](#description)

A tool to create [PlantUML](http://plantuml.sourceforge.net/) class diagrams from your PHP source.

Currently the following language features are supported:

- Property and method visibility
- Static properties and methods
- Method return types from doc comment
- Parameter types from type hinting and doc comment
- Parameter default values
- Class constants with value
- Property types from doc comment
- Property default values
- Implemented interfaces and parent classes
- Abstract classes

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

[](#requirements)

To generate the PlantUML code a decent version of PHP will suffice. And you need Composer to install the dependencies:

- Composer ()

But for image generation you need:

- Java Runtime
- `plantuml.jar` ()

### Phar generation

[](#phar-generation)

php-plantumlwriter uses [Box 2 library](https://box-project.github.io/box2/) to generate a single .phar file containing everything required for the usage.

To create the .phar file from sources just run:

```
$ box build

```

Usage
-----

[](#usage)

To generate the PlantUML code for `WriteCommand.php` run

```
php bin/php-plantumlwriter write src/Flagbit/Plantuml/Command/WriteCommand.php > WriteCommand.puml

```

which will output

```
@startuml
class Flagbit.Plantuml.Command.WriteCommand {
    #configure()
    #execute(input: Symfony.Component.Console.Input.InputInterface, output: Symfony.Component.Console.Output.OutputInterface)
}
class Flagbit.Plantuml.Command.WriteCommand extends Symfony.Component.Console.Command.Command
@enduml

```

Now you can convert your `puml` file to a `png` file.:

```
java -jar plantuml.jar WriteCommand.puml

```

The resulting png should look like this:

[![WriteCommand Class Diagram](https://camo.githubusercontent.com/9b980868d568b67f147d1b7fe01e9ec3f053dbcdccb113ff80132c6511867ad2/68747470733a2f2f6461766964667568722e6769746875622e696f2f7068702d706c616e74756d6c7772697465722f696d672f5772697465436f6d6d616e642e706e67)](https://camo.githubusercontent.com/9b980868d568b67f147d1b7fe01e9ec3f053dbcdccb113ff80132c6511867ad2/68747470733a2f2f6461766964667568722e6769746875622e696f2f7068702d706c616e74756d6c7772697465722f696d672f5772697465436f6d6d616e642e706e67)

If you have a large class with lots of methods you can suppress method printing using the `--without-methods` flag:

```
php bin/php-plantumlwriter write --without-methods path/to/your/LargeClass.php

```

Other available options are `--without-properties` and `--without-constants`.

You can also generate a whole directory at once:

```
php bin/php-plantumlwriter write path/to/directory

```

Or multiple files or directories:

```
php bin/php-plantumlwriter write path/to/ClassOne.php path/to/ClassTwo.php path/to/directory

```

Known Issues
------------

[](#known-issues)

- Imported classes are currently not handled correctly if read from doc comment (use-Statement is not fully evaluated) which affects return values and property types. `use Namespace\B` will be evaluated and expanded but `use Namespace\B as C`is not yet de-aliased.
- The Namespace Seperator is "." and not "".
- Traits are not yet supported. See [\#4](https://github.com/davidfuhr/php-plantumlwriter/issues/4)

Future Plans
------------

[](#future-plans)

- Add support for class relations, maybe with quantifiers. This could be parsed from the doc comments. We could also guess the foreign quantifier (`@var OtherClass` as "*..1" and `@var OtherClass[]` as "*..\*"), but we can't determine our quantifier. If doctrine annotations are present we can use them.
- Evaluate Implementation of Visitor Pattern
- Implement own set of Interfaces

Alternatives
------------

[](#alternatives)

-

###  Health Score

39

—

LowBetter than 85% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity36

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

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

###  Release Activity

Cadence

Every ~163 days

Recently: every ~201 days

Total

6

Last Release

3928d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/446054?v=4)[David Fuhr](/maintainers/davidfuhr)[@davidfuhr](https://github.com/davidfuhr)

---

Top Contributors

[![davidfuhr](https://avatars.githubusercontent.com/u/446054?v=4)](https://github.com/davidfuhr "davidfuhr (26 commits)")[![EmanueleMinotto](https://avatars.githubusercontent.com/u/417201?v=4)](https://github.com/EmanueleMinotto "EmanueleMinotto (3 commits)")[![bravoman](https://avatars.githubusercontent.com/u/1729802?v=4)](https://github.com/bravoman "bravoman (1 commits)")

---

Tags

uml

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/davidfuhr-php-plantumlwriter/health.svg)

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

###  Alternatives

[friendsoftypo3/content-blocks

TYPO3 CMS Content Blocks - Content Types API | Define reusable components via YAML

101466.4k45](/packages/friendsoftypo3-content-blocks)[php-soap/wsdl

Deals with WSDLs

183.8M18](/packages/php-soap-wsdl)[phel-lang/phel-lang

Phel is a functional programming language that compiles to PHP

5155.1k17](/packages/phel-lang-phel-lang)

PHPackages © 2026

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