A modern, opinionated GitHub template repository for building PHP 8.5+ packages and libraries with standardized quality tooling, static analysis, and automated CI/CD workflows.
- PHP 8.5+: Configured with strict types (
declare(strict_types=1);) and platform version8.5.0. - Testing: Codeception 5 Unit suite with AI Reporter integration for structured test output.
- Static Analysis: PHPStan at Level 8 (
phpstan.neon). - Coding Standards: PHP-CS-Fixer with centralized configuration via
webproject-xyz/php-cs-fixer-config. - Git Hooks: GrumPHP pre-commit automation running style checks, static analysis, and test suites.
- Continuous Integration: Reusable GitHub Actions CI workflow with matrix testing and test coverage generation.
- Release Automation: Pre-configured Semantic Release (
.releaserc) and Renovate (renovate.json).
Use GitHub's web interface by clicking "Use this template" → "Create a new repository", or use the GitHub CLI:
gh repo create <vendor>/<package-name> --template WebProject-xyz/php-package-template --public --clone
cd <package-name>composer installInitialize GrumPHP to enable pre-commit quality checks:
vendor/bin/grumphp git:initAfter initializing the project, adjust the configuration to match your package:
composer.json:- Update
name,description,authors, andhomepage. - Update the PSR-4 autoload namespaces:
WebProject\PhpPackageTemplate\→YourVendor\YourPackage\WebProject\PhpPackageTemplate\Tests\→YourVendor\YourPackage\Tests\
- Update
- Codeception Configuration:
- Update
namespaceincodeception.yml. - Update
suite_namespaceintests/Unit.suite.yml. - Update namespaces in
tests/Support/UnitTester.phpandtests/Unit/ExampleTest.php.
- Update
README.md:- Replace this template documentation with specific documentation for your package.
All development scripts are defined in composer.json with XDEBUG_MODE=off (except code coverage) to maximize execution speed.
| Command | Description |
|---|---|
composer qa |
Executes the complete QA suite (test:build, cs:fix, test, stan). |
composer test |
Runs the Codeception test suite (codecept run --report). |
composer test:build |
Generates / rebuilds Codeception Actor classes (codecept build). |
composer test:coverage |
Runs tests and generates an XML coverage report (coverage.xml). |
composer stan |
Runs PHPStan static analysis at Level 8 without progress bars. |
composer cs:check |
Checks coding standards with PHP-CS-Fixer in dry-run mode showing diffs. |
composer cs:fix |
Automatically fixes code styling violations with PHP-CS-Fixer. |
Please see CONTRIBUTING.md for contribution guidelines, pull request processes, and branch naming conventions.
Distributed under the MIT License. See LICENSE for details.
- Issues: GitHub Issue Tracker
- Website: webproject.xyz