spryker/project-architecture-sniffer
Composer 安装命令:
composer require spryker/project-architecture-sniffer
包简介
Spryker Project Architecture Sniffer
README 文档
README
Architecture Sniffer for Spryker Projects. Over 80 rules adapted for Spryker Projects.
Priority Levels
-
1: Сritical -
2: Major -
3: Medium -
4: Minor
We recommend minimum priority 3 by default for local and CI checks.
Note: Lower priorities (higher numbers) always include the higher priorities (lower numbers).
Content
29adapted PHPMD rules39adapted Spryker Architecture sniffer rules13new Project Architecture sniffer rules
Usage
Make sure you include the sniffer as require-dev dependency:
composer require --dev spryker/project-architecture-sniffer
Running
Find command line option.
You can run the Project Architecture Sniffer from console by using:
vendor/bin/phpmd src/Pyz/ text vendor/spryker/project-architecture-sniffer/src/ruleset.xml --minimumpriority 3
Baseline
Existing projectsand demo-shops may contain rule violations. The decision to refactor existing violations may be at the discretion of each project individually. It is recommended to approach this in a differentiated manner. To integrate rules into the project immediately, there recommended to generate a baseline and move forward. It is also permissible to suppress rules on a case-by-case basis.
Ruleset
Ruleset that contains all documented rules
vendor/spryker/project-architecture-sniffer/src/ruleset.xml
Ruleset that contains Spryker Architecture sniffer rules and Project Architecture sniffer rules
vendor/spryker/project-architecture-sniffer/src/Project/ruleset.xml
Ruleset that contains PHPMD rules
vendor/spryker/project-architecture-sniffer/src/PhpMd/ruleset.xml
More
Find vendor/spryker/project-architecture-sniffer/src/
├── PhpMd
│ ├── cleancode.xml
│ ├── codesize.xml
│ ├── controversial.xml
│ ├── design.xml
│ ├── naming.xml
│ ├── ruleset.xml
│ └── unusedcode.xml
├── Project
│ ├── Client
│ │ └── ruleset.xml
│ ├── Common
│ │ └── ruleset.xml
│ ├── Glue
│ │ └── ruleset.xml
│ ├── Service
│ │ └── ruleset.xml
│ ├── Shared
│ │ └── ruleset.xml
│ ├── Yves
│ │ └── ruleset.xml
│ ├── Zed
│ │ └── ruleset.xml
│ └── ruleset.xml
└── ruleset.xml
Local Code Review Usage
vendor/bin/phpmd src json vendor/spryker/project-architecture-sniffer/src/ruleset.xml --minimumpriority 4 --reportfile results.json
cp vendor/spryker/project-architecture-sniffer/tools/script.php script.php
php script.php
Debugging
docker/sdk cli -x
PHPMD_ALLOW_XDEBUG=true vendor/bin/phpmd src/Pyz/ text vendor/spryker/project-architecture-sniffer/src/ruleset.xml --minimumpriority 3
Roadmap (expected rules)
feel free to suggest
Writing new sniffs
Add them to inside src/Project folder with the same folder structure.
Don't forget to update ruleset.xml.
Every sniff needs to implement either the ClassAware, FunctionAware, InterfaceAware, or MethodAware interface to be recognised.
Setup
Run
composer install
Testing
no testing at this moment
Running code-sniffer on this project
Make sure this repository is Spryker coding standard conform:
composer cs-check
If you want to fix the fixable errors, use
composer cs-fix
If you want to run phpstan
composer stan
Once everything is green you can make a PR with your changes.
spryker/project-architecture-sniffer 适用场景与选型建议
spryker/project-architecture-sniffer 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 13.07k 次下载、GitHub Stars 达 2, 最近一次更新时间为 2024 年 01 月 10 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「framework」 「standards」 「sniffer」 「architecture」 「spryker」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 spryker/project-architecture-sniffer 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 spryker/project-architecture-sniffer 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 spryker/project-architecture-sniffer 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
PHP Framework HLEB2 is the foundation of the web application. Provides ease of development and application performance.
PHP_CodeSniffer custom Sniff for Laravel coding standard
Internal PHP coding standard of ProjektMOTOR
A set of abstractions that define core services provided by the DVSA
This is the ZooRoyal coding standard.
PHP Codesniffer ruleset to follow Laravel's coding style
统计信息
- 总下载量: 13.07k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 5
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-01-10