infection/extension-installer
Composer plugin bundled with Infection that automatically discovers and registers Infection extensions on install/update. Install an infection-extension package and it’s registered without manual config. Includes guidance for building extensions via composer.json metadata.
Begin by installing infection/extension-installer as a dev dependency:
composer require --dev infection/extension-installer
Next, install an Infection extension package (e.g., infection/extension-mutation-testing or community-supported ones like infection/extra-mutators). The installer will automatically detect it during composer install and register it in your infection.json or infection.json.dist file—no manual config edits required. The first use case is typically enhancing mutation testing coverage beyond core mutators, such as enabling array or string-specific mutators. Check composer.json’s extra.infection.extensions section for auto-discovered extensions.
Note for PHP 8.1+ users: This release drops support for PHP <7.4, so ensure your environment meets the new minimum requirement.
require-dev (e.g., "infection/extra-mutators": "^0.3"), then run composer update. The installer hooks into Composer’s install/update events to auto-configure infection.json with the extension’s mutators/plugins.infection.json.dist in version control; the installer respects CI and local setups identically—ideal for Dockerized or GitHub Actions workflows where reproducibility matters. The installer now uses GitHub Actions for its own CI, ensuring compatibility with modern workflows."extra": { "infection": { "disable-extension-installer": true } } in composer.json—useful for custom mutator setups.actions/cache)—since the installer avoids runtime checks after initial setup, it keeps infection command startup time minimal.infection-extension package type. If a third-party extension lacks this in its composer.json, it won’t auto-register—verify composer show -t for installed extensions.infection.json already defines mutators from a newly installed extension, the installer skips duplication but does not warn. Check infection.json after composer update to avoid gaps in coverage.^0.24). Mismatched versions (e.g., installing extra-mutators with Infection 0.23.x) cause runtime errors. Pin Infection and extensions in composer.json ("infection/infection": "^0.25.0", "infection/extra-mutators": "^0.3.1").config.php or CI environment uses PHP 7.4+ to avoid installation failures. PHP 8.1 is now explicitly supported."type": "infection-extension" and provide an extra.infection.class pointing to a factory class implementing Infection\Extension\ExtensionInterface. The installer will auto-detect it on install.composer diag and composer update -vvv to see installer logs. Missing infection.json? The installer won’t create it automatically—ensure an initial config file exists (even minimal) before installing extensions.How can I help you explore Laravel packages today?