Testing
Konten ini belum tersedia dalam bahasa Anda.
This package provides a consistent set of Composer scripts for local validation.
Tool references:
- Composer Require Checker for dependency definition checks.
- Easy Coding Standard (ECS) for coding standards.
- PHPStan for static analysis.
- Rector for automated refactoring.
Automated refactoring (Rector)
Section titled “Automated refactoring (Rector)”Run Rector to apply automated code refactoring. This command modifies files.
composer rectorPreview the refactoring without modifying files.
composer rector-checkCoding standards (ECS)
Section titled “Coding standards (ECS)”Check coding standards without modifying files.
composer ecs-checkApply coding standard fixes. Review the changes before keeping them.
composer ecsDependency definition check
Section titled “Dependency definition check”Verify that runtime dependencies are correctly declared in composer.json.
composer check-dependenciesStatic analysis (PHPStan)
Section titled “Static analysis (PHPStan)”Run static analysis.
composer staticRepository quality checks
Section titled “Repository quality checks”Make the CLI tools used by the shared PHP Forge quality workflow available on PATH: actionlint with ShellCheck,
codespell, EditorConfig Checker, markdownlint-cli2, Prettier, and yamllint.
composer qualityEach check also has its own script.
composer actionlintcomposer codespellcomposer editorconfig-checkercomposer markdownlintcomposer prettiercomposer yamllintLinter configuration lives in .github/linters. Prettier uses its default configuration without repository-specific
configuration or ignore files. CI uses the same configuration choices; tool versions can differ locally.
Workflow security checks
Section titled “Workflow security checks”Make zizmor and Gitleaks available on PATH. Run both checks with the same pedantic persona and Gitleaks configuration
used by CI.
composer securityEach tool also has its own script. Zizmor uses GitHub API access for online audits; an explicit offline check is available.
composer zizmor -- --offlinecomposer gitleaksReport hosted CI execution and its PHP/OS matrix separately from local checks. Keep generated maintainer reports in
ignored internal/.
Passing extra arguments
Section titled “Passing extra arguments”Composer scripts support forwarding additional arguments using --.
Run ECS with a different memory limit.
composer ecs -- --memory-limit=512M