VOOZH about

URL: https://deepwiki.com/MahoCommerce/maho/11-development-and-quality-assurance

⇱ Development and Quality Assurance | MahoCommerce/maho | DeepWiki


Loading...
Last indexed: 15 May 2026 (ea8ab8)
Menu

Development and Quality Assurance

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.


Overview

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:

ComponentPurposeConfiguration File
PHPStanStatic analysis (Level 6).phpstan.dist.neon
PHP-CS-FixerCode style enforcement (PER-CS2.0).php-cs-fixer.php
RectorAutomated refactoring and modernization.rector.php
Pest/PHPUnitTesting frameworkphpunit.xml
GitHub ActionsCI/CD pipeline.github/workflows/*.yml
ComposerDependency managementcomposer.json

Sources: .php-cs-fixer.php1-42 .github/workflows/phpstan.yml1-62 .github/workflows/rector.yml1-41 .github/workflows/pest.yml1-181


Development Workflow

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


Static Analysis with PHPStan

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

Configuration and Baselines

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


Code Style with PHP-CS-Fixer

PHP-CS-Fixer enforces the PER-CS2.0 coding standard with additional rules for modernization and consistency .php-cs-fixer.php13

Configuration


Diagram: PHP-CS-Fixer Configuration Structure

Key Rules

RuleTypePurpose
@PER-CS2.0StandardBase PHP coding standard .php-cs-fixer.php13
logical_operatorsRISKYReplace and/or with &&/`
modernize_types_castingRISKYUse type casting operators instead of functions .php-cs-fixer.php17
nullable_type_declaration_for_default_null_valuePHP 8.4Add ? for nullable parameters with null default .php-cs-fixer.php19
single_quoteStyleUse single quotes for simple strings .php-cs-fixer.php21

Sources: .php-cs-fixer.php1-42


Automated Refactoring with Rector

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


Testing Infrastructure

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

Multi-Database Testing Matrix

Maho supports a variety of database backends, and the test suite validates compatibility across all of them .github/workflows/pest.yml19-56

EngineVersions TestedEnvironment
MySQL8.4, LatestDocker Service
MariaDB10.11, LatestDocker Service
PostgreSQL14, LatestDocker Service
SQLiteNative PHPIn-memory/File

Running Tests

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


CI/CD Pipeline

The CI/CD pipeline consists of multiple GitHub Actions workflows that run on every push and pull request.

Syntax and Integrity Validation

Security and Maintenance

  • Security Scanning: Scans composer.lock for known vulnerabilities.
  • Composer Validation: Ensures composer.json and composer.lock are valid and in sync.

For more details, see CI/CD Pipeline and Security Best Practices.


IDE Support

Maho provides deep integration for modern IDEs to improve developer experience (DX).

  • Metadata Generation: Support for generating PHPStorm metadata for factory methods.
  • Maho Intelligence: A dedicated module providing LSP (Language Server Protocol) and MCP (Model Context Protocol) servers for advanced IDE and AI assistant integration.
  • VS Code Support: Pre-configured settings and tasks are included in the repository .gitignore3-8

For setup instructions, see IDE Support and Type Hints.

Sources: .gitignore1-11 .github/workflows/phpstan.yml1-10