nmangold / composer-remedy
A Composer plugin to automatically detect and resolve dependency conflicts, with a focus on Drupal projects.
Package info
github.com/nmangold/composer-remedy
Type:composer-plugin
pkg:composer/nmangold/composer-remedy
dev-main
2026-04-15 04:17 UTC
Requires
- php: >=8.2
- composer-plugin-api: ^2.0
Requires (Dev)
- composer/composer: ^2.7
- phpstan/phpstan: ^2.1
- phpunit/phpunit: ^11.0
- squizlabs/php_codesniffer: ^4.0
This package is auto-updated.
Last update: 2026-04-15 04:23:15 UTC
README
A production-quality Composer plugin that automatically detects and resolves dependency conflicts, with a strong focus on Drupal projects.
๐ฏ Features
- Programmatic Conflict Analysis: Uses Composer's internal solver to detect conflicts accurately.
- Dependency Graph Building: Maps out the relationships between conflicting packages.
- Minimal Resolution Planning: Computes the smallest set of version changes required to fix conflicts.
- Risk Assessment: Classifies the risk level of suggested changes (LOW, MEDIUM, HIGH, EXTREME).
- Drupal Integration: Specific rules for
drupal/coreanddrupal/core-recommended. - Dry-run and Auto-apply: See the plan or apply it automatically.
๐ฆ Installation
composer require nmangold/composer-remedy
โ๏ธ Usage
When you encounter a dependency conflict, run:
composer drupal:fix-conflicts
Options
--dry-run: Show the resolution plan without making any changes.--apply: Automatically executecomposer requirewith the computed version fixes.
๐ Architecture
The plugin follows SOLID principles and uses a service-oriented architecture:
ConflictAnalyzer: Triggers a simulated update to captureSolverProblemsException.DependencyGraphBuilder: Constructs a graph of involved packages.ResolutionPlanner: Iteratively relaxes constraints to find a valid resolution.RiskAnalyzer: Evaluates the impact of version bumps.DrupalAnalyzer: Applies Drupal-specific logic for core and modules.
๐งช Testing
Run the test suite with PHPUnit:
vendor/bin/phpunit
๐ก License
This project is licensed under the MIT License.