iaroslav-khmel/project-map
Composer 安装命令:
composer require iaroslav-khmel/project-map
包简介
PHP project structure mapper for Laravel, Symfony and generic PHP projects.
README 文档
README
iaroslav-khmel/project-map is a Composer package and CLI tool that statically scans PHP projects and builds a first technical map: classes, methods, method calls, framework routes and models.
It is framework-agnostic by default and includes static MVP adapters for Laravel and Symfony. It never scans vendor/ and does not execute the analysed application in generic mode.
Requirements
- PHP
^8.2|^8.3|^8.4 - Composer
Local Development Via Path Repository
In the project where you want to test the package, add a path repository:
{
"repositories": [
{
"type": "path",
"url": "../project-map",
"options": {
"symlink": true
}
}
]
}
Install it:
composer require --dev iaroslav-khmel/project-map:@dev
Run the scanner:
vendor/bin/project-map scan
CLI
vendor/bin/project-map scan \ --path=. \ --output=storage/project-map \ --format=json,dot,svg,html \ --framework=auto \ --graph=all \ --max-depth=3 \ --include-tests=false \ --exclude=vendor,node_modules,storage,bootstrap/cache,var/cache,tests
Options:
--pathproject path, defaults to current directory--outputoutput directory, defaults to.project-map--formatcomma-separated formats:json,dot,svg,html,mmd--frameworkone ofauto,laravel,symfony,generic--graphone ofclasses,routes,models,all--max-depthmaximum method call depth from route entrypoints--include-testsinclude test files in the graph, defaults tofalse--excludecomma-separated directories to skip;vendoris always excluded
Output
The JSON graph payload is written to:
.project-map/project-map.json
The DOT graph is written to:
.project-map/project-map.dot
If Graphviz dot is available, the SVG graph is written to:
.project-map/project-map.svg
The HTML report embeds the SVG graph as the main project map and is written to:
.project-map/index.html
Mermaid remains available as an optional extra format: .project-map/project-map.mmd.
Current MVP
Generic PHP scanning includes namespaces, class-like declarations, inheritance, interfaces, traits, method signatures, visibility, parameters, return types, method calls, static calls and object creation. Dynamic calls that cannot be resolved are stored as unknown_call warnings.
Laravel support includes recursive AST parsing of routes/, route includes, route groups with prefix/middleware/name/controller context, Route::get/post/put/patch/delete/options/any/match/resource/apiResource, Eloquent models, table names, fillable/guarded/casts/hidden/appends, relations and best-effort migration fields.
Symfony support includes attribute routes and Doctrine entity attributes. YAML route parsing is reported as an MVP warning instead of failing.
Development
composer install
composer test
统计信息
- 总下载量: 1
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-06-23