pds/composer-script-names
Standardizes Composer script naming for PHP packages: lowercase with dashes. Defines canonical script names for common tasks like test, test-coverage, test-*, cs-fix, analyse/analyze, and check, improving consistency across projects.
Start by reading the README and understanding the standardized script naming conventions it defines. This package is not a library you install—it’s a specification published under the PHP-DSG (PHP Development Standards Group). To adopt it:
composer.json under the "scripts" section.test, test-coverage, cs-fix, analyse, check, and test-* for specialized workflows.phpunit, php-cs-fixer) with test and cs-fix to align with community expectations.composer.json:
{
"scripts": {
"test": "phpunit",
"test-coverage": "phpunit --coverage-html storage/coverage",
"cs-fix": "php-cs-fixer fix",
"analyse": "phpstan analyse src",
"check": ["cs-fix", "analyse", "test"]
}
}
test-* (e.g., "test-integration": "phpunit tests/Integration"). Prefix test- avoids ambiguity and follows Pascal’s Casing convention (via dash separation).composer.json template or scaffolding script (e.g., via Composer’s create-project) that enforces compliant scripts by default.Test or cs_Fix violate the spec—Composer itself is case-insensitive on Windows but scripts must be lower-case per spec for cross-platform reliability.test:unit or cs_fix are non-compliant—only dashes (-) are allowed as word separators.analyse vs analyze: Choose one spelling consistently across your org. Use analyze for American English projects, analyse for British/Irish/Australian alignment. Don’t define both unless explicitly supporting dual spelling in a shared toolchain (not recommended).phpunit → test), run composer dump-autoload or clear Composer’s cache (composer clear-cache) to avoid stale autocomplete.composer.json scripts. Rename your scripts to match the spec for smoother “Run Script” integrations and keymap bindings.composer test, composer check, etc.—not hardcoded commands like ./vendor/bin/phpunit. This future-proofs your pipeline.How can I help you explore Laravel packages today?