loophp/grumphp-license-task
GrumPHP extension adding a “license” task to ensure your project has a valid LICENSE file. Creates it if missing or offers to fix it if invalid. Supports common OSI licenses (MIT, BSD-3-Clause, LGPL, EUPL) with holder/year options.
spatie/laravel-grumphp or standalone GrumPHP).loophp/grumphp-license-task).grumphp.yml (extension + task).input option).LICENSE Files: May overwrite or conflict with manually curated licenses. Mitigation: Use input option to specify a custom file.input to merge licenses manually.date_from) be managed in CI?spatie/laravel-grumphp or standalone GrumPHP setups.phpstan, php-cs-fixer, or security-checker.LICENSE files across repositories to identify:
composer require loophp/grumphp-license-task --dev
grumphp.yml:
grumphp:
extensions:
- loophp\GrumphpLicenseTask\Extension
tasks:
license:
name: MIT
holder: "Your Company"
date_from: 2023
input option to reference a custom file.tasks:
license:
input: "path/to/custom/LICENSE.txt"
composer.json constraints).LICENSE files unless using input.license task early in the pipeline to fail fast if licenses are invalid.license task early in the pipeline (e.g., after composer install but before tests).- name: Run GrumPHP License Check
run: vendor/bin/grumphp run
composer.json periodically (low effort).grumphp.yml configurations in a template or shared config to avoid repo-specific deviations.LICENSE files.input to override auto-generation.date_from and holder fields are correct.--verbose for task-specific logs.## License Compliance
This repo uses GrumPHP to enforce the MIT license. The `LICENSE` file is auto-generated and validated on every commit.
grumphp.yml via composer.json scripts.LICENSE files before GrumPHP runs.| Failure Scenario | Impact | Mitigation |
|---|---|---|
Missing LICENSE file |
GrumPHP fails (configurable) | Auto-generates file on first run (default behavior). |
| Invalid license format | GrumPHP fails | Fix template or use input to reference a valid file. |
| CI permissions denied |
How can I help you explore Laravel packages today?