Skip to content

Commit

Permalink
Add support for Composer v2
Browse files Browse the repository at this point in the history
  • Loading branch information
mcaskill committed May 5, 2020
1 parent 6039bf3 commit 658b03e
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ matrix:
- php: 7.1
- php: 7.2
- php: 7.3
- php: 7.3
env:
- COMPOSER_SNAPSHOT=true
- php: 7.4
env:
- deps=high
Expand Down Expand Up @@ -44,6 +47,8 @@ install:
- if [[ $deps == 'high' ]]; then composer config platform.php 7.2.4; composer update $flags; fi
# install dependencies
- composer install $flags
# install snapshot of composer
- if [[ $COMPOSER_SNAPSHOT == 'true' ]]; then composer require composer/composer:^2.0@dev --prefer-stable --update-with-dependencies; fi

script:
- ./vendor/bin/simple-phpunit
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
],
"require": {
"php": "^5.3.2 || ^7.0",
"composer-plugin-api": "^1.0"
"composer-plugin-api": "^1.0 || ^2.0"
},
"require-dev": {
"composer/composer": "^1.0",
"composer/composer": "^1.0 || ^2.0",
"symfony/phpunit-bridge": "^3.4"
},
"conflict": {
Expand Down
28 changes: 28 additions & 0 deletions src/ExcludeFilePlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,34 @@ public function activate(Composer $composer, IOInterface $io)
$this->composer = $composer;
}

/**
* Remove any hooks from Composer.
*
* @codeCoverageIgnore
*
* @param Composer $composer The Composer instance.
* @param IOInterface $io The Input/Output instance.
* @return void
*/
public function deactivate(Composer $composer, IOInterface $io)
{
// no need to deactivate anything
}

/**
* Prepare the plugin to be uninstalled.
*
* @codeCoverageIgnore
*
* @param Composer $composer The Composer instance.
* @param IOInterface $io The Input/Output instance.
* @return void
*/
public function uninstall(Composer $composer, IOInterface $io)
{
// no need to uninstall anything
}

/**
* Gets a list of event names this subscriber wants to listen to.
*
Expand Down

0 comments on commit 658b03e

Please sign in to comment.