![]() |
VOOZH | about |
This page documents the development workflow, quality assurance processes, and testing infrastructure for Maho. It covers code quality tools (PHPStan, PHP-CS-Fixer, Rector), automated testing with Pest, the CI/CD pipeline using GitHub Actions, and security best practices.
For information about setting up a local development environment, see Development Environment Setup. For details on the CI/CD automation, see CI/CD Pipeline. For static analysis details, see Static Analysis and Code Quality. For testing methodology, see Testing with Pest. For security-specific practices, see Security Best Practices. For dependency updates, see Dependency Management and Modernization. For IDE integration, see IDE Support and Type Hints.
Maho employs a comprehensive quality assurance strategy combining static analysis, automated testing, and continuous integration. The development workflow emphasizes modern PHP 8.3+ features, type safety, and automated code quality checks.
Key Components:
| Component | Purpose | Configuration File |
|---|---|---|
| PHPStan | Static analysis (Level 6) | .phpstan.dist.neon |
| PHP-CS-Fixer | Code style enforcement (PER-CS2.0) | .php-cs-fixer.php |
| Rector | Automated refactoring and modernization | .rector.php |
| Pest/PHPUnit | Testing framework | phpunit.xml |
| GitHub Actions | CI/CD pipeline | .github/workflows/*.yml |
| Composer | Dependency management | composer.json |
Sources: .php-cs-fixer.php1-42 .github/workflows/phpstan.yml1-62 .github/workflows/rector.yml1-41 .github/workflows/pest.yml1-181
The following diagram illustrates the lifecycle of a code change, from local development to the automated checks in the CI/CD pipeline.
Diagram: Development and CI/CD Workflow
Sources: .github/workflows/phpstan.yml1-62 .github/workflows/rector.yml1-41 .github/workflows/pest.yml1-181 .github/workflows/syntax-php.yml1-65 .github/workflows/copyright.yml1-100 .github/workflows/check-missing-translations.yml35-45
PHPStan performs static analysis at Level 6, providing strong type checking. The analysis runs on PHP 8.3, 8.4, and 8.5 to ensure forward compatibility .github/workflows/phpstan.yml19
Maho maintains a baseline to manage legacy issues while enforcing strict rules on new code. The CI workflow includes cache restoration and saving for the result cache in the var/ directory to optimize execution speed .github/workflows/phpstan.yml43-62
Running Locally:
For more details on rules and baselines, see Static Analysis and Code Quality.
Sources: .github/workflows/phpstan.yml13-62 .gitignore37-40
PHP-CS-Fixer enforces the PER-CS2.0 coding standard with additional rules for modernization and consistency .php-cs-fixer.php13
Diagram: PHP-CS-Fixer Configuration Structure
| Rule | Type | Purpose |
|---|---|---|
@PER-CS2.0 | Standard | Base PHP coding standard .php-cs-fixer.php13 |
logical_operators | RISKY | Replace and/or with &&/` |
modernize_types_casting | RISKY | Use type casting operators instead of functions .php-cs-fixer.php17 |
nullable_type_declaration_for_default_null_value | PHP 8.4 | Add ? for nullable parameters with null default .php-cs-fixer.php19 |
single_quote | Style | Use single quotes for simple strings .php-cs-fixer.php21 |
Sources: .php-cs-fixer.php1-42
Rector performs automated code modernization and refactoring, helping maintain modern PHP 8.3+ patterns throughout the codebase .github/workflows/rector.yml20
Running Locally:
The CI pipeline runs Rector in dry-run mode to ensure no refactorings are pending .github/workflows/rector.yml40
Sources: .github/workflows/rector.yml1-41
Maho uses Pest PHP as the primary testing framework. The CI pipeline tests against multiple database engines in parallel using a GitHub Actions matrix strategy .github/workflows/pest.yml16-55
Maho supports a variety of database backends, and the test suite validates compatibility across all of them .github/workflows/pest.yml19-56
| Engine | Versions Tested | Environment |
|---|---|---|
| MySQL | 8.4, Latest | Docker Service |
| MariaDB | 10.11, Latest | Docker Service |
| PostgreSQL | 14, Latest | Docker Service |
| SQLite | Native PHP | In-memory/File |
Local Execution:
The CI pipeline installs Maho using the ./maho install command before executing the test suite to ensure a clean state with sample data .github/workflows/pest.yml103-122
For detailed test organization and integration patterns, see Testing with Pest.
Sources: .github/workflows/pest.yml1-181
The CI/CD pipeline consists of multiple GitHub Actions workflows that run on every push and pull request.
php -l .github/workflows/syntax-php.yml13-19xmllint .github/workflows/syntax-xml.yml42-58.php, .phtml, and .js files contain the required Maho copyright notice. The check uses a regex pattern to validate the year range and URL .github/workflows/copyright.yml65-96./maho dev:translations:missing and ./maho dev:translations:unused to maintain translation integrity .github/workflows/check-missing-translations.yml37 .github/workflows/check-unused-translations.yml35composer.lock for known vulnerabilities.composer.json and composer.lock are valid and in sync.For more details, see CI/CD Pipeline and Security Best Practices.
Maho provides deep integration for modern IDEs to improve developer experience (DX).
For setup instructions, see IDE Support and Type Hints.
Refresh this wiki