Skip to content

Commit

Permalink
Composer 2 compatibility (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
navarr authored May 27, 2021
1 parent 709e164 commit b7d3419
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 6 deletions.
4 changes: 3 additions & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ WARDEN_ENV_NAME=depends
WARDEN_ENV_TYPE=laravel
WARDEN_WEB_ROOT=/
WARDEN_PHP=1
PHP_VERSION=7.2
COMPOSER_VERSION=2
PHP_VERSION=7.4
TRAEFIK_DOMAIN=depends.test
TRAEFIK_SUBDOMAIN=app
WARDEN_COMPOSER_DIR=./.composer
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
vendor/
composer.lock
.composer/
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"license": "MIT",
"require": {
"php": "^7.2",
"composer-plugin-api": "^1.0",
"composer/composer": "^1",
"composer-plugin-api": "^1|^2",
"composer/composer": "^1|^2",
"composer/semver": "^1|^2|^3",
"symfony/console": "^5"
},
Expand Down
2 changes: 1 addition & 1 deletion src/Command/WhyBlockCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
use Symfony\Component\Console\Output\OutputInterface;

/**
* @dependency composer/composer:^1 Extends BaseCommand
* @dependency composer/composer:^1|^2 Extends BaseCommand
*/
class WhyBlockCommand extends BaseCommand
{
Expand Down
15 changes: 13 additions & 2 deletions src/Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,19 @@
/**
* In charge of registering everything our plugin needs
*
* @dependency composer-plugin-api:^1 Reliant Interfaces
* @dependency composer/composer:^1 Existence of IOInterface and Composer class
* @dependency composer-plugin-api:^1|^2 Reliant Interfaces
* @dependency composer/composer:^1|^2 Existence of IOInterface and Composer class
*/
class Plugin implements PluginInterface, Capable, CommandProvider
{
public function activate(Composer $composer, IOInterface $io): void
{
/* No-op */
}

public function deactivate(Composer $composer, IOInterface $io): void
{
/* No-op */
}

public function getCapabilities(): array
Expand All @@ -39,4 +45,9 @@ public function getCommands(): array
new WhyBlockCommand(),
];
}

public function uninstall(Composer $composer, IOInterface $io): void
{
/* No-op */
}
}

0 comments on commit b7d3419

Please sign in to comment.