Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Composer v2 #7

Merged
merged 2 commits into from
May 5, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 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 All @@ -41,13 +44,15 @@ install:
# flags to pass to install
- flags="--ansi --prefer-dist --no-interaction --optimize-autoloader --no-suggest --no-progress"
# update deps to latest in case of high deps build
- if [[ "$deps" == "high" ]]; then composer config platform.php 7.2.4; composer update $flags; fi
# install dependencies using system provided composer binary
- 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

after_script:
- if [[ "$TRAVIS_PHP_VERSION" == '7.4' ]]; then composer require php-coveralls/php-coveralls ; fi
- if [[ "$TRAVIS_PHP_VERSION" == '7.4' ]]; then php vendor/bin/php-coveralls -v ; fi
- if [[ $TRAVIS_PHP_VERSION == '7.4' ]]; then composer require php-coveralls/php-coveralls; fi
- if [[ $TRAVIS_PHP_VERSION == '7.4' ]]; then php vendor/bin/php-coveralls -v; fi
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