承接 patbator/lachesis 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

patbator/lachesis

Composer 安装命令:

composer create-project patbator/lachesis

包简介

README 文档

README

Lachesis (/ˈlækɪsɪs/ LAK-iss-iss; Ancient Greek: Λάχεσις, romanized: Lákhesis, lit. 'disposer of lots'; from λαγχάνω lanchánō, 'to obtain by lot, by fate, or by the will of the gods'), in ancient Greek religion, was the middle of the Three Fates, or Moirai; the others were her sisters, Clotho and Atropos. Normally seen clothed in whiteLachesis is the measurer of the thread spun on Clotho's spindle, and in some texts, determines Destiny, or thread of life.

-- Wikipedia contributors, "Lachesis," Wikipedia, The Free Encyclopedia, https://en.wikipedia.org/w/index.php?title=Lachesis&oldid=1169650823 (accessed July 28, 2024).

A tool to discover how your PHP code is weaved.

Install

Get this source code and then use Composer:

composer install

Usage

This tool provide a command in its bin directory.

bin/lachesis analyze <baseDirectory>

Lachesis will find all PHP files recursively starting at the specified baseDirectory. For each file it will detect classes definitions and collect them as well as their collaborators i.e. :

  • parent (extends), setting current class as child of it
  • implemented interfaces, setting current class/interface as implementor of them
  • received types as method parameters, setting current class/interface as receiver of them
  • returned types as method return, setting current class/interface as returner of them

We end with a fabric describing reciprocal links between:

  • parent <-> children (extends)
  • implementations <-> implementors
  • received <-> receivers
  • returned <-> returners

The analyze command output a JSON array representative of the fabric on STDOUT that you can save in a file:

bin/lachesis analyze /path/to/php/source/code > /path/to/desired/output_file.json

Output example for Lachesis Fabric class:

{
    "id": "47c7f147c86ec190a6cb3b700bc9fd31b8688b85", // generated id from FQN
    "name": "Lachesis\\Fabric",
    "parent": null, // extends nothing
    "implementations": [
        { // implement PhpParser\NodeVisitor
            "id": "05bef068d987505bdfc10cb371a8f5bb84e73e16",
            "name": "PhpParser\\NodeVisitor"
        }
    ],
    "implementors": [], // implemented by nothing as it is not an interface
    "received": [
        { // received in __construct
            "id": "88bc6161bb25a2869d6980ee6fb71c6276959c01",
            "name": "PhpParser\\Parser"
        },
        { // received in __construct
            "id": "b55c17f51da4bc7cee24c1234d7b2fae57f156fb",
            "name": "PhpParser\\NodeTraverserInterface"
        },
        { // received in eachNodeDo
            "id": "84e77ec95c5a92eb909c6ac217e1a65e9bf9d350",
            "name": "Closure"
        },
        { // received in enterNode and leaveNode
            "id": "00eb6b01a21c654b4ad34ba160edb47d4fe4f960",
            "name": "PhpParser\\Node"
        }
    ],
    "receivers": [], // nobody receive it 
    "returned": [], // return nothing
    "returners": [] // nobody return it
}

License

Copyright (c) 2024 Patrick Barroca patrick.barroca@gmail.com

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see http://www.gnu.org/licenses/gpl-3.0.html.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: AGPL-3.0-only
  • 更新时间: 2024-07-28

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固