Skip to content

Commit

Permalink
Return early for Composer 2
Browse files Browse the repository at this point in the history
  • Loading branch information
zaporylie committed Oct 6, 2020
1 parent d8af537 commit b9d5b64
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@ class Plugin implements PluginInterface

public function activate(Composer $composer, IOInterface $io)
{
if (version_compare('2.0.0', PluginInterface::PLUGIN_API_VERSION, '<=')) {
if ($io->isVerbose()) {
$io->write(sprintf('zaporylie/composer-drupal-optimizations is disabled for Composer 2'));
}
// Return early.
return;
}
// Set default version constraints based on the composer requirements.
$extra = $composer->getPackage()->getExtra();
$packages = $composer->getPackage()->getRequires();
Expand Down

0 comments on commit b9d5b64

Please sign in to comment.