terminal42/contao-build-tools
Experimental, highly opinionated build tools for Contao bundles/websites. Auto-configures code quality and style tooling (ECS/CS-Fixer, Rector, PHPStan, Stylelint) via Composer scripts, with CI workflow support. Not for production use.
src/ directory, Contao-specific namespaces like Contao\). Laravel’s app/ structure and App\ namespace create fundamental conflicts:
src/ for code; Laravel uses app/.Contao\ namespace, which may incorrectly flag Laravel’s App\ or Illuminate\ classes.includeSystemModules()), irrelevant to Laravel’s composer-based autoloading.src/). Laravel’s config/, routes/, and database/ directories would require manual overrides or rejection.phpstan.neon rules) are incompatible without heavy customization.composer.json scripts (e.g., artisan) may clash with Contao’s composer run commands.src/ directory for code.| Risk Area | Severity (1-5) | Mitigation Strategy |
|---|---|---|
| Namespace Collisions | 5 | Isolate Contao-specific tools in a subproject or fork. |
| Tool Overrides Needed | 4 | Customize ecs.php, phpstan.neon, and rector.php to remove Contao rules. |
| CI/CD Disruption | 3 | Replace GitHub Action with Laravel-compatible workflows. |
| Maintenance Burden | 4 | Avoid; use standalone tools (phpstan/laravel, laravel-pint). |
| Dependency Bloat | 2 | Optional tools (Deployer) can be excluded. |
src/ directory constraint?
phpstan/phpstan + Laravel extensions).post-autoload-dump or post-update-cmd may conflict with Contao’s composer run commands.src/ directory).| Scenario | Recommended Approach |
|---|---|
| Laravel Project | Do not use. Replace with: |
- Code Quality: phpstan/phpstan + phpstan/extension-installer + phpstan/laravel. |
|
- CS Fixer: friendsofphp/php-cs-fixer + laravel-pint. |
|
| - Deploy: Laravel Forge, Envoyer, or custom Deployer config. | |
| Contao Project | Use as-is; customize configs: |
1. Install: composer require --dev terminal42/contao-build-tools. |
|
2. Override defaults in ecs.php, phpstan.neon, etc. |
|
| 3. Test CI/CD with the provided GitHub Action (may need adjustments). | |
| Hybrid (Contao + Laravel) | Isolate tools: Run Contao-specific tools in a separate Composer script. |
Example: Add to composer.json: |
|
| ```json | |
| "scripts": { | |
| "contao-cq": "vendor/bin/phpstan analyse --level=max src/ && ..." | |
| } | |
| ``` |
deployer/deployer is optional but not Laravel-compatible.src/ directory assumption.Contao\ vs. App\).Contao\BackendTemplate).composer require --dev phpstan/phpstan phpstan/extension-installer phpstan/laravel
composer require --dev friendsofphp/php-cs-fixer laravel-pint
# phpstan.neon
includes:
- vendor/phpstan/extension-installer/phpstan.neon
- vendor/phpstan/phpstan-laravel/phpstan.neon
phpstan and pint).composer require --dev terminal42/contao-build-tools
ecs.php, phpstan.neon).build-tools script and GitHub Action.deployer/deployer).laravel-pint, phpstan/laravel) is actively maintained and optimized for Laravel.src/ directory).How can I help you explore Laravel packages today?