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

Update to Composer Plugin-API 2.0 #10

Merged
merged 2 commits into from
Oct 24, 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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
],
"require": {
"php": "^7.1",
"composer-plugin-api": "^1.1",
"composer-plugin-api": "^1.1|^2.0",
"captainhook/captainhook": "^5.0"
},
"require-dev": {
Expand Down
30 changes: 30 additions & 0 deletions src/ComposerPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,36 @@ public function activate(Composer $composer, IOInterface $io): void
$this->io = $io;
}

/**
* Remove any hooks from Composer
*
* This will be called when a plugin is deactivated before being
* uninstalled, but also before it gets upgraded to a new version
* so the old one can be deactivated and the new one activated.
*
* @param Composer $composer
* @param IOInterface $io
*/
public function deactivate(Composer $composer, IOInterface $io)
{
// Do nothing currently
}

/**
* Prepare the plugin to be uninstalled
*
* This will be called after deactivate.
*
* @param Composer $composer
* @param IOInterface $io
*/
public function uninstall(Composer $composer, IOInterface $io)
{
// Do nothing currently
}



/**
* Make sure the installer is executed after the autoloader is created
*
Expand Down