ateliee/plantuml-parser 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

ateliee/plantuml-parser

Composer 安装命令:

composer require ateliee/plantuml-parser

包简介

PlantUML parse package

README 文档

README

Build Status Coverage Status Latest Stable Version Codacy Badge License: MIT

PlantUMLの書き込み・読み込みができるものがなかったので作成。

usage

  • PHP 5.5.38 >=

機能

PlantUMLは機能が多いので、読み取り・出力のみサポート。

論理式は今の所対応しない予定

対応範囲

  • Use Case (ユースケース図)
  • Activity (アクティビティ図)
  • State (ステートチャート図)
  • Sequence (シーケンス図)
  • Class (クラス図)
  • Object (オブジェクト図)
  • Component (コンポーネント図)
  • Component (パッケージ図)
  • Component (配置図)

install

composer require ateliee/plantuml-parser

example

<?php
require_once __DIR__ . '/../vendor/autoload.php';

use Ateliee\PlantUMLParser\PUMLParser;
use Ateliee\PlantUMLParser\PUMLKeyValue;
use Ateliee\PlantUMLParser\PUMLStr;
use Ateliee\PlantUMLParser\PUMLElementList;
use Ateliee\PlantUMLParser\Structure\PUMLSkinParam;
use Ateliee\PlantUMLParser\Structure\PUMLDefine;
use Ateliee\PlantUMLParser\Structure\PUMLPackage;
use Ateliee\PlantUMLParser\Structure\PUMLEntity;
use Ateliee\PlantUMLParser\Structure\PUMLRelation;

$uml = new PUMLElementList();

$uml->add((new PUMLDefine('MAIN_ENTITY', '#FCE4D6-F8CBAD'))->setComment("commnt to here"));

$uml->add(
    (new PUMLSkinParam('class'))
        ->setComment("default style.")
        ->add(new PUMLKeyValue('BackgroundColor', 'METAL'))
        ->add(new PUMLKeyValue('BorderColor', 'Black'))
        ->add(new PUMLKeyValue('ArrowColor', 'Black'))
);

$uml->add(
    (new PUMLPackage('DB', 'ext', '<<Database>>'))
        ->add(
            (new PUMLEntity('Customer', 'customer'))
                ->add(new PUMLStr('+ ID [PK]'))
                ->add(new PUMLStr('--'))
                ->add(new PUMLStr('name'))
                ->add(new PUMLStr('zip'))
                ->add(new PUMLStr('address'))
                ->add(new PUMLStr('tel'))
                ->add(new PUMLStr('fax'))
        )
);
$uml->add(
    (new PUMLPackage('開発対象システム', 'target_system'))
        ->add(
            (new PUMLEntity('注文テーブル', 'order', '<<主,TRANSACTION_MARK_COLOR>> MAIN_ENTITY'))
                ->add(new PUMLStr('+ 注文ID [PK]'))
                ->add(new PUMLStr('--'))
                ->add(new PUMLStr('# 顧客ID [FK]'))
                ->add(new PUMLStr('注文日時'))
                ->add(new PUMLStr('配送希望日'))
                ->add(new PUMLStr('配送方法'))
                ->add(new PUMLStr('お届け先名'))
                ->add(new PUMLStr('お届け先住所'))
                ->add(new PUMLStr('決済方法'))
                ->add(new PUMLStr('合計金額'))
                ->add(new PUMLStr('消費税額'))
                ->setComment("マスターテーブルを M、トランザクションを T などと安直にしていますが、
チーム内でルールを決めればなんでも良いと思います。交差テーブルは \"I\" とか。
角丸四角形が描けない代替です。
1文字なら \"主\" とか \"従\" とか日本語でも OK だったのが受ける。")
        )
);

$uml->add(
    (new PUMLRelation('customer', '|o-ri-o{', 'order'))
);

$plant_uml = new PUMLParser();
$plant_uml->save(__DIR__.'/test.puml', $uml);
@startuml

/' commnt to here '/
!define MAIN_ENTITY #FCE4D6-F8CBAD

/' default style. '/
skinparam class{
  BackgroundColor METAL
  BorderColor Black
  ArrowColor Black
}

package "DB" as ext <<Database>>{
  entity "Customer" as customer{
    + ID [PK]
    --
    name
    zip
    address
    tel
    fax
  }
}

package "開発対象システム" as target_system{

  /'
    マスターテーブルを M、トランザクションを T などと安直にしていますが、
    チーム内でルールを決めればなんでも良いと思います。交差テーブルは "I" とか。
    角丸四角形が描けない代替です。
    1文字なら "主" とか "従" とか日本語でも OK だったのが受ける。
  '/
  entity "注文テーブル" as order <<主,TRANSACTION_MARK_COLOR>> MAIN_ENTITY{
    + 注文ID [PK]
    --
    # 顧客ID [FK]
    注文日時
    配送希望日
    配送方法
    お届け先名
    お届け先住所
    決済方法
    合計金額
    消費税額
  }
}

customer |o-ri-o{ order

@enduml

参考

统计信息

  • 总下载量: 23
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 0
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-09-29

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固