Skip to content

Commit

Permalink
Merge pull request #10 from CaptainHookPhp/updateToComposerPluginApi2
Browse files Browse the repository at this point in the history
Update to Composer Plugin-API 2.0
  • Loading branch information
sebastianfeldmann committed Oct 24, 2020
2 parents 3e122bc + 48cb2de commit 25c294a
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 1 deletion.
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

0 comments on commit 25c294a

Please sign in to comment.