Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Extension Installer Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Getting Started

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.

Implementation Patterns

  • Declarative Dependency Management: Declare Infection extensions in 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.
  • Environment Agnosticism: Use 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.
  • Opt-in Extension Control: Override or disable automatic registration by adding "extra": { "infection": { "disable-extension-installer": true } } in composer.json—useful for custom mutator setups.
  • CI Optimization: Pair with caching (e.g., GitHub Actions’ actions/cache)—since the installer avoids runtime checks after initial setup, it keeps infection command startup time minimal.

Gotchas and Tips

  • Outdated Packagist Metadata: The installer relies on 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.
  • Silent Failure on Invalid Config: If 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.
  • Infection Version Compatibility: Extensions often require specific Infection versions (e.g., ^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").
  • PHP Version Requirement: This release drops support for PHP <7.4. Ensure your project’s config.php or CI environment uses PHP 7.4+ to avoid installation failures. PHP 8.1 is now explicitly supported.
  • Extensibility: To build a custom extension, define "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.
  • Debugging: Run 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.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
milesj/emojibase
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport