Skip to content

Commit

Permalink
Merge pull request #19 from jawira/theme
Browse files Browse the repository at this point in the history
Add theme support
  • Loading branch information
jawira authored Aug 30, 2021
2 parents f2a2d9f + d8970be commit 11a788f
Show file tree
Hide file tree
Showing 53 changed files with 447 additions and 279 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@
/config/doctrine-url.php
/.php_cs.cache
/.php-cs-fixer.cache
/cobertura.xml
/resources/output/
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@ $midi = $dbDraw->generatePuml(DbDraw::MIDI); // like mini with columns
$maxi = $dbDraw->generatePuml(DbDraw::MAXI); // like midi with views
```

![mini-diagram](resources/output/mini.png)
![mini-diagram](docs/images/mini.png)

![midi-diagram](resources/output/midi.png)
![midi-diagram](docs/images/midi.png)

![maxi-diagram](resources/output/maxi.png)
![maxi-diagram](docs/images/maxi.png)

## Installing

Expand Down
23 changes: 10 additions & 13 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<property name="db.host" value="mysql"/>

<target name="setup" depends="composer:install,dc:up,dc:ip"/>
<target name="qa" depends="composer:validate,composer:normalize,cs:fix,phpstan:analyze,phpunit:run"/>
<target name="qa" depends="composer:validate,composer:normalize,cs:fix,phpstan:analyze,phpunit:run,plantuml:convert"/>

<target name="dc:up" description="Launch containers">
<exec executable="docker-compose" passthru="true" checkreturn="true">
Expand Down Expand Up @@ -98,17 +98,19 @@
</target>

<target name="plantuml:convert" description="Convert puml to png">
<exec executable="plantuml" checkreturn="true" passthru="true">
<exec executable="vendor/bin/plantuml" checkreturn="true" passthru="true">
<arg value="-tpng"/>
<arg value="-nometadata"/>
<arg value="-output"/>
<arg path="docs/images"/>
<arg file="resources/output/*.puml"/>
</exec>
</target>

<target name="phpunit:run" description="Run PHPUnit tests" depends="db:wait-for-database">
<exec executable="vendor/bin/phpunit" passthru="true" checkreturn="true">
<env key="DB_HOST" value="${db.host}"/>
<arg line="--colors=always"/>
<env key="XDEBUG_MODE" value="coverage"/>
</exec>
</target>

Expand All @@ -121,21 +123,16 @@
</target>

<target name="help">
<uptodate property="uptodate.build" srcfile="build.xml" targetfile="docs/images/build.png"/>
<if>
<not>
<isset property="uptodate.build"/>
</not>
<then>
<visualizer format="png" destination="docs/images"/>
</then>
</if>
<uptodate property="visualizer.up-to-date" srcfile="build.xml" targetfile="docs/images/build.png"/>
<runtarget target="visualizer"/>
<exec executable="xdg-open" spawn="true">
<arg file="docs/images/build.png"/>
</exec>
</target>


<target name="visualizer" unless="visualizer.up-to-date">
<visualizer format="png" destination="docs/images"/>
</target>

<target name="cs:fix" description="Fix code style">
<exec executable="vendor/bin/php-cs-fixer" passthru="true" checkreturn="true">
Expand Down
5 changes: 3 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "jawira/db-draw",
"type": "library",
"description": "\uD83D\uDCD0 Create an ER diagram from your existing DB",
"description": "\ud83d\udcd0 Create an ER diagram from your existing DB",
"keywords": [
"database",
"db",
Expand All @@ -16,7 +16,7 @@
}
],
"require": {
"php": ">=7.3",
"php": "^7.3 || ^8.0",
"doctrine/dbal": "^2.5",
"jawira/the-lost-functions": "^1.1"
},
Expand All @@ -26,6 +26,7 @@
"ext-xml": "*",
"ergebnis/composer-normalize": "^2.13",
"friendsofphp/php-cs-fixer": "^3.0",
"jawira/plantuml": "^1.59",
"jawira/plantuml-client": "^1.0",
"jawira/skeleton": "^2.0",
"phpstan/phpstan": "^0.12.82",
Expand Down
12 changes: 12 additions & 0 deletions docs/dev.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,15 @@ PHPUnit needs a mysql database to run tests, this is handled by `docker-composer
```console
phing setup qa:remote
```

Running tests locally:

```console
phing qa -Ddb.host=172.23.0.2
```

PHPUnit without Phing:

```console
DB_HOST=172.23.0.2 vendor/bin/phpunit tests/DiagramTest.php testTheme
```
Binary file modified docs/images/build.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/maxi.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/midi.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
Binary file added docs/images/theme-amiga.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/theme-aws-orange.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/theme-black-knight.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/theme-bluegray.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/theme-blueprint.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/theme-cerulean-outline.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/theme-cerulean.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/theme-crt-amber.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/theme-crt-green.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/theme-cyborg-outline.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/theme-cyborg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/theme-hacker.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/theme-lightgray.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/theme-materia-outline.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/theme-materia.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/theme-metal.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/theme-mimeograph.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/theme-minty.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/theme-plain.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/theme-resume-light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/theme-sandstone.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/theme-silver.png
Binary file added docs/images/theme-sketchy-outline.png
Binary file added docs/images/theme-sketchy.png
Binary file added docs/images/theme-spacelab.png
Binary file added docs/images/theme-superhero-outline.png
Binary file added docs/images/theme-superhero.png
Binary file added docs/images/theme-toy.png
Binary file added docs/images/theme-united.png
Binary file added docs/images/theme-vibrant.png
264 changes: 264 additions & 0 deletions docs/themes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,264 @@
# Themes

## amiga

```php
use Jawira\DbDraw\{DbDraw, Theme};
$puml = $dbDiagram->generatePuml(DbDraw::MINI, Theme::AMIGA);
```

![amiga](images/theme-amiga.png)

## black-knight

```php
use Jawira\DbDraw\{DbDraw, Theme};
$puml = $dbDiagram->generatePuml(DbDraw::MINI, Theme::BLACK_KNIGHT);
```

![black-knight](images/theme-black-knight.png)

## bluegray

```php
use Jawira\DbDraw\{DbDraw, Theme};
$puml = $dbDiagram->generatePuml(DbDraw::MINI, Theme::BLUEGRAY);
```

![bluegray](images/theme-bluegray.png)

## blueprint

```php
use Jawira\DbDraw\{DbDraw, Theme};
$puml = $dbDiagram->generatePuml(DbDraw::MINI, Theme::BLUEPRINT);
```

![blueprint](images/theme-blueprint.png)

## cerulean

```php
use Jawira\DbDraw\{DbDraw, Theme};
$puml = $dbDiagram->generatePuml(DbDraw::MINI, Theme::CERULEAN);
```

![cerulean](images/theme-cerulean.png)

## cerulean-outline

```php
use Jawira\DbDraw\{DbDraw, Theme};
$puml = $dbDiagram->generatePuml(DbDraw::MINI, Theme::CERULEAN_OUTLINE);
```

![cerulean-outline](images/theme-cerulean-outline.png)

## crt-amber

```php
use Jawira\DbDraw\{DbDraw, Theme};
$puml = $dbDiagram->generatePuml(DbDraw::MINI, Theme::CRT_AMBER);
```

![crt-amber](images/theme-crt-amber.png)

## crt-green

```php
use Jawira\DbDraw\{DbDraw, Theme};
$puml = $dbDiagram->generatePuml(DbDraw::MINI, Theme::CRT_GREEN);
```

![crt-green](images/theme-crt-green.png)

## cyborg

```php
use Jawira\DbDraw\{DbDraw, Theme};
$puml = $dbDiagram->generatePuml(DbDraw::MINI, Theme::CYBORG);
```

![cyborg](images/theme-cyborg.png)

## cyborg-outline

```php
use Jawira\DbDraw\{DbDraw, Theme};
$puml = $dbDiagram->generatePuml(DbDraw::MINI, Theme::CYBORG_OUTLINE);
```

![cyborg-outline](images/theme-cyborg-outline.png)

## hacker

```php
use Jawira\DbDraw\{DbDraw, Theme};
$puml = $dbDiagram->generatePuml(DbDraw::MINI, Theme::HACKER);
```

![hacker](images/theme-hacker.png)

## lightgray

```php
use Jawira\DbDraw\{DbDraw, Theme};
$puml = $dbDiagram->generatePuml(DbDraw::MINI, Theme::LIGHTGRAY);
```

![lightgray](images/theme-lightgray.png)

## materia

```php
use Jawira\DbDraw\{DbDraw, Theme};
$puml = $dbDiagram->generatePuml(DbDraw::MINI, Theme::MATERIA);
```

![materia](images/theme-materia.png)

## materia-outline

```php
use Jawira\DbDraw\{DbDraw, Theme};
$puml = $dbDiagram->generatePuml(DbDraw::MINI, Theme::MATERIA_OUTLINE);
```

![materia-outline](images/theme-materia-outline.png)

## metal

```php
use Jawira\DbDraw\{DbDraw, Theme};
$puml = $dbDiagram->generatePuml(DbDraw::MINI, Theme::METAL);
```

![metal](images/theme-metal.png)

## mimeograph

```php
use Jawira\DbDraw\{DbDraw, Theme};
$puml = $dbDiagram->generatePuml(DbDraw::MINI, Theme::MIMEOGRAPH);
```

![mimeograph](images/theme-mimeograph.png)

## minty

```php
use Jawira\DbDraw\{DbDraw, Theme};
$puml = $dbDiagram->generatePuml(DbDraw::MINI, Theme::MINTY);
```

![minty](images/theme-minty.png)

## plain

```php
use Jawira\DbDraw\{DbDraw, Theme};
$puml = $dbDiagram->generatePuml(DbDraw::MINI, Theme::PLAIN);
```

![plain](images/theme-plain.png)

## resume-light

```php
use Jawira\DbDraw\{DbDraw, Theme};
$puml = $dbDiagram->generatePuml(DbDraw::MINI, Theme::RESUME_LIGHT);
```

![resume-light](images/theme-resume-light.png)

## sandstone

```php
use Jawira\DbDraw\{DbDraw, Theme};
$puml = $dbDiagram->generatePuml(DbDraw::MINI, Theme::SANDSTONE);
```

![sandstone](images/theme-sandstone.png)

## silver

```php
use Jawira\DbDraw\{DbDraw, Theme};
$puml = $dbDiagram->generatePuml(DbDraw::MINI, Theme::SILVER);
```

![silver](images/theme-silver.png)

## sketchy

```php
use Jawira\DbDraw\{DbDraw, Theme};
$puml = $dbDiagram->generatePuml(DbDraw::MINI, Theme::SKETCHY);
```

![sketchy](images/theme-sketchy.png)

## sketchy-outline

```php
use Jawira\DbDraw\{DbDraw, Theme};
$puml = $dbDiagram->generatePuml(DbDraw::MINI, Theme::SKETCHY_OUTLINE);
```

![sketchy-outline](images/theme-sketchy-outline.png)

## spacelab

```php
use Jawira\DbDraw\{DbDraw, Theme};
$puml = $dbDiagram->generatePuml(DbDraw::MINI, Theme::SPACELAB);
```

![spacelab](images/theme-spacelab.png)

## superhero

```php
use Jawira\DbDraw\{DbDraw, Theme};
$puml = $dbDiagram->generatePuml(DbDraw::MINI, Theme::SUPERHERO);
```

![superhero](images/theme-superhero.png)

## superhero-outline

```php
use Jawira\DbDraw\{DbDraw, Theme};
$puml = $dbDiagram->generatePuml(DbDraw::MINI, Theme::SUPERHERO_OUTLINE);
```

![superhero-outline](images/theme-superhero-outline.png)

## toy

```php
use Jawira\DbDraw\{DbDraw, Theme};
$puml = $dbDiagram->generatePuml(DbDraw::MINI, Theme::TOY);
```

![toy](images/theme-toy.png)

## united

```php
use Jawira\DbDraw\{DbDraw, Theme};
$puml = $dbDiagram->generatePuml(DbDraw::MINI, Theme::UNITED);
```

![united](images/theme-united.png)

## vibrant

```php
use Jawira\DbDraw\{DbDraw, Theme};
$puml = $dbDiagram->generatePuml(DbDraw::MINI, Theme::VIBRANT);
```

![vibrant](images/theme-vibrant.png)


Loading

0 comments on commit 11a788f

Please sign in to comment.