From 2cf2a33090f674ca78671b4f3e4aea60d1af1027 Mon Sep 17 00:00:00 2001 From: jrfnl Date: Wed, 1 Apr 2020 17:57:57 +0200 Subject: [PATCH] Support Composer 2.0 Minimal changes to updated the plugin to support Composer 2.0 which is expected late May/beginning of June. Changes are based on guidance found in: * https://github.com/Dealerdirect/phpcodesniffer-composer-installer/issues/108 * https://github.com/composer/composer/issues/8726 * https://github.com/composer/composer/blob/master/UPGRADE-2.0.md#for-integrators-and-plugin-authors Tested by danepowell and myself (Windows 7). Further testing would be very welcome! Fixes 108 --- composer.json | 2 +- src/Plugin.php | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index a25b062e..441510e6 100644 --- a/composer.json +++ b/composer.json @@ -24,7 +24,7 @@ }, "require": { "php": ">=5.3", - "composer-plugin-api": "^1.0", + "composer-plugin-api": "^1.0 || ^2.0", "squizlabs/php_codesniffer": "^2 || ^3 || 4.0.x-dev" }, "require-dev": { diff --git a/src/Plugin.php b/src/Plugin.php index 847405d8..0591f2f9 100644 --- a/src/Plugin.php +++ b/src/Plugin.php @@ -124,6 +124,20 @@ public function activate(Composer $composer, IOInterface $io) $this->init(); } + /** + * {@inheritDoc} + */ + public function deactivate(Composer $composer, IOInterface $io) + { + } + + /** + * {@inheritDoc} + */ + public function uninstall(Composer $composer, IOInterface $io) + { + } + /** * Prepares the plugin so it's main functionality can be run. *