How eonx-com/easy-quality works
Main components
• Quality Tools Core Package – This is the overall “Easy Quality” package.
• Submodules:
– Rectors: (located in src/Rector and corresponding tests) handle automatic code transformations. They apply strict rules (e.g. AddSeeAnnotationRector, ExplicitBoolCompareRector, etc.).
– Sniffs: (under src/Sniffs) define custom rules for PHP_CodeSniffer, grouped under categories such as Arrays, Attributes, Classes, Commenting, etc.
– PHPStan Rules: (under src/PhpStan) include custom static analysis rules.
– Helpers/Utilities: (e.g. src/Helper, src/Output, and ValueObjects) support the above components.
• Configuration/Quality Setup:
– Configurations for ECS, Rector, PHPStan, and related tooling are provided in the config/ and quality/ directories.
– Documentation (docs folder) guides the use and setup of these tools.
• Tests:
– A comprehensive tests folder mirrors the structure of the core (including tests for each Rector, Sniff, and PHPStan rule) ensuring that the rules behave as expected.
• Integration & Deployment:
– Composer files (composer.json, composer.lock) and CI workflows (e.g., .github/workflows/php-ci.yml) show how the package is integrated and how quality checks are automated.
– GitHub Actions YAML snippets indicate how the quality tools are invoked (for example, by running “composer check-all” or individual scripts).
Relationships and interactions
• The core quality package (in src) provides all the reusable rule classes.
• The configuration files (in config/ and quality/) are used to set up these tools. They “connect” to the corresponding quality tools (ECS, Rector, PHPStan) so that when these tools run, they load the custom rules from the package.
• The Composer scripts (defined in composer.json and referenced in README) orchestrate the execution of these components in parallel and in CI.
• The tests folder shows that each submodule (Rectors, Sniffs, PHPStan rules) is individually unit tested to validate proper behavior.
Architectural patterns & design principles
• Separation of Concerns: Each quality-related module is split by responsibility. Rectors modify code, Sniffs check coding style, and PHPStan rules perform static analysis.
• Modularity: The rules and helpers are self-contained so they can be reused in different projects.
• Extensibility: Additional custom rules can be added following the provided folder structure, and configuration is centralized.
• Integration via Composer: The package is designed to be installed by other projects via Composer and invoked through standardized scripts.
Including key technologies and frameworks
• PHP and Composer (dependency management/integration)
• PHP_CodeSniffer (for sniff-based code standards)
• Rector (for automated refactoring)
• PHPStan (for static analysis rules)
• GitHub Actions (for CI integration)
• Helper libraries (custom classes in Helper, Output, and ValueObject directories)