PHPackages                             unloc/composer-compatibility-enforcer - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. unloc/composer-compatibility-enforcer

ActiveWordpress-muplugin

unloc/composer-compatibility-enforcer
=====================================

Remove selected namespaces/classes from plugin Composer autoloaders.

1.0.1(2mo ago)2256↓25%MITPHPPHP &gt;=8.1

Since Feb 3Pushed 2mo agoCompare

[ Source](https://github.com/unlocnl/composer-compatibility-enforcer)[ Packagist](https://packagist.org/packages/unloc/composer-compatibility-enforcer)[ Docs](https://github.com/unlocnl/composer-compatibility-enforcer)[ RSS](/packages/unloc-composer-compatibility-enforcer/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (3)Used By (0)

Composer Compatibility Enforcer
===============================

[](#composer-compatibility-enforcer)

Removes selected namespaces and classes from plugin Composer autoloaders to avoid vendor conflicts.

This is primarily useful in Bedrock projects running Roots Acorn, where multiple Composer autoloaders can introduce conflicting versions of shared libraries. For background, see the [Acorn compatibility notes](https://roots.io/acorn/docs/compatibility/).

This MU plugin aims to provide a cleaner alternative to often brittle Composer patches. It does not ship with default rules; configure it via a WordPress filter.

Requirements
------------

[](#requirements)

- PHP 8.1+
- WordPress 5.9+
- Composer-based WordPress installation (e.g., Bedrock)

Installation
------------

[](#installation)

```
composer require unloc/composer-compatibility-enforcer
```

The package type is `wordpress-muplugin`, so it will automatically install to `web/app/mu-plugins/` on Bedrock setups.

Configuration
-------------

[](#configuration)

This plugin ships with no default rules. Add rules via the `composer_compatibility_enforcer_rules` filter.

Since this is an MU plugin, the filter must be registered in code that loads before or during `plugins_loaded` (priority &lt; 11). The recommended approach is a separate MU plugin file:

**`web/app/mu-plugins/composer-compatibility-enforcer-rules.php`**

```
