PHPackages                             mk-conn/plant2code - 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. mk-conn/plant2code

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

mk-conn/plant2code
==================

Create basic code (classes, interfaces, etc.) from PlantUML class diagrams

1.0.13(6y ago)231126proprietaryPHPPHP &gt;=7.0

Since Jan 17Pushed 6y ago2 watchersCompare

[ Source](https://github.com/mk-conn/plant2code)[ Packagist](https://packagist.org/packages/mk-conn/plant2code)[ RSS](/packages/mk-conn-plant2code/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (3)Dependencies (5)Versions (16)Used By (0)

Plant2Code
==========

[](#plant2code)

Plant2Code can be used to generate (currently only PHP) classes from your [plantuml](http://plantuml.com/class-diagram) class diagramm. It converts the plantuml class diagramm into XMI and creates the target language class files based on the XMI declarations.

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

[](#requirements)

- current Java RE (on Mac the JDK is required) - don't know about Windows systems, I didn't and will not test there.
- PHP &gt;= 7.x
- [Composer](https://getcomposer.org)

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

[](#installation)

### Global

[](#global)

Install:

```
$ composer global require mk-conn/plant2code

```

Update:

```
$ composer global update mk-conn/plant2code

```

### Somewhere in a folder of your choise

[](#somewhere-in-a-folder-of-your-choise)

Clone or download this repository. Run `composer install --no-dev` from the root directory (omit the --no-dev option, if you intend to develop in this project). Done.

### Within a project

[](#within-a-project)

In your composer.json:

```
"require": {
    ...
    "mk-conn/plant2code": "^v1.0.0"
  },

```

Running
-------

[](#running)

### From global

[](#from-global)

```
$ plant2code puml:convert path/to/input.puml --output="path/to/output/dir" [--lang="php"] [--root-ns="SomeNamespace"]

```

- **--output** Optional output directory (must exists) where classes are written to. Defaults to the folder where the \*.puml input files is stored.
- **--lang**: Optional target language - defaults to PHP
- **--root-ns**: Optional root namespace - this will be prepend to the detected namespaces

### From project directoy

[](#from-project-directoy)

```
path/to/plant2code $ bin/plant2code puml:convert path/to/input.puml --output="path/to/output/dir" [--lang="php"] [--root-ns="SomeNamespace"]

```

Output
------

[](#output)

Success:

[![Success](doc/plant2code_success.png)](doc/plant2code_success.png)

Failure:

[![Failure](doc/plant2code_failure.png)](doc/plant2code_failure.png)

Tips
----

[](#tips)

Although it is possible to write class properties and methods like this in plantuml:

```
class Test {
    string #name // or #string name
}

```

the required syntax for plant2code to work correctly is:

```
class Test {
    #name : string

    +update(arg1 : int, arg2 string)
}

```

Features not yet implemented
----------------------------

[](#features-not-yet-implemented)

- option to format code output
- more languages (Java, Ruby, JavaScript)

Thanks
------

[](#thanks)

Thanks goes out to the plantuml developers who let me use the binary **plantuml.jar** which is distributed under LGPL. And another big thanks to the developers who implemented my suggestions and wishes in no time very quick!

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity66

Established project with proven stability

 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 ~73 days

Recently: every ~222 days

Total

14

Last Release

2457d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/5840922?v=4)[Marko Krüger](/maintainers/mk-conn)[@mk-conn](https://github.com/mk-conn)

---

Top Contributors

[![mk-conn](https://avatars.githubusercontent.com/u/5840922?v=4)](https://github.com/mk-conn "mk-conn (22 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/mk-conn-plant2code/health.svg)

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

###  Alternatives

[barryvdh/laravel-ide-helper

Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.

14.9k123.0M687](/packages/barryvdh-laravel-ide-helper)[orchestra/canvas

Code Generators for Laravel Applications and Packages

21017.2M158](/packages/orchestra-canvas)[illuminate/session

The Illuminate Session package.

9937.4M753](/packages/illuminate-session)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)[flarum/core

Delightfully simple forum software.

211.3M1.9k](/packages/flarum-core)[barryvdh/laravel-form-bridge

This packages integrates Symfony Form Component in Laravel.

163354.8k1](/packages/barryvdh-laravel-form-bridge)

PHPackages © 2026

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