Architecture Sniffer for Spryker Projects. Over 80
rules adapted for Spryker Projects.
-
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).
29
adapted PHPMD rules39
adapted Spryker Architecture sniffer rules13
new Project Architecture sniffer rules
Make sure you include the sniffer as require-dev
dependency:
composer require --dev spryker/project-architecture-sniffer
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
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.
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
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
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
docker/sdk cli -x
PHPMD_ALLOW_XDEBUG=true vendor/bin/phpmd src/Pyz/ text vendor/spryker/project-architecture-sniffer/src/ruleset.xml --minimumpriority 3
feel free to suggest
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.
Run
composer install
no testing at this moment
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.