# eonx-com/easy-quality architecture

> Architecture diagram of the GitHub repository eonx-com/easy-quality, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-03-31). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/eonx-com/easy-quality
- Repository: https://github.com/eonx-com/easy-quality

## Overview

##### 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)

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Easy Quality Package"
        QCQ["Quality Tools Core Package"]:::blue
        subgraph "Core Modules"
            Rectors["Rectors Module (e.g., AddSeeAnnotationRector,ExplicitBoolCompareRector)"]:::blue
            Sniffs["Sniffs Module (Arrays,Attributes,Classes,Commenting,…)"]:::blue
            PhpStan["PHPStan Rules Module"]:::blue
            Helpers["Helpers & Utility Classes"]:::blue
        end
        Config["Configuration & Quality Setup (ECS,Rector,PHPStan)"]:::green
    end

    Docs["Documentation"]:::blue
    Tests["Tests Suite (Unit tests for each module)"]:::grey
    Integration["Integration & Deployment (Composer,CI)"]:::orange

    %% Connections
    Integration -->|"run_ecs/rector/phpstan_commands"| QCQ
    Config -->|"configuration_loading"| Rectors
    Config -->|"configuration_loading"| Sniffs
    Config -->|"configuration_loading"| PhpStan
    QCQ -->|"verify_rule_behavior"| Tests
    Docs --> QCQ

    %% Click Events
    click QCQ "https://github.com/eonx-com/easy-quality/tree/main/src"
    click Rectors "https://github.com/eonx-com/easy-quality/tree/main/src/Rector"
    click Rectors "https://github.com/eonx-com/easy-quality/tree/main/tests/Rector"
    click Sniffs "https://github.com/eonx-com/easy-quality/tree/main/src/Sniffs"
    click Sniffs "https://github.com/eonx-com/easy-quality/tree/main/tests/Sniffs"
    click PhpStan "https://github.com/eonx-com/easy-quality/tree/main/src/PhpStan"
    click PhpStan "https://github.com/eonx-com/easy-quality/tree/main/tests/PhpStan"
    click Helpers "https://github.com/eonx-com/easy-quality/tree/main/src/Helper"
    click Helpers "https://github.com/eonx-com/easy-quality/tree/main/src/Output"
    click Helpers "https://github.com/eonx-com/easy-quality/tree/main/src/ValueObject"
    click Config "https://github.com/eonx-com/easy-quality/tree/main/config"
    click Config "https://github.com/eonx-com/easy-quality/tree/main/quality"
    click Docs "https://github.com/eonx-com/easy-quality/tree/main/docs"
    click Tests "https://github.com/eonx-com/easy-quality/tree/main/tests"
    click Integration "https://github.com/eonx-com/easy-quality/blob/main/composer.json"
    click Integration "https://github.com/eonx-com/easy-quality/blob/main/composer.lock"
    click Integration "https://github.com/eonx-com/easy-quality/blob/main/.github/workflows/php-ci.yml"

    %% Styles
    classDef blue fill:#add8e6,stroke:#000,stroke-width:2px;
    classDef green fill:#90ee90,stroke:#000,stroke-width:2px;
    classDef orange fill:#ffa500,stroke:#000,stroke-width:2px;
    classDef grey fill:#d3d3d3,stroke:#000,stroke-width:2px;
```
