Skip to content

Commit b7d3419

Browse files
authored
Composer 2 compatibility (#5)
1 parent 709e164 commit b7d3419

File tree

5 files changed

+20
-6
lines changed

5 files changed

+20
-6
lines changed

.env

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ WARDEN_ENV_NAME=depends
22
WARDEN_ENV_TYPE=laravel
33
WARDEN_WEB_ROOT=/
44
WARDEN_PHP=1
5-
PHP_VERSION=7.2
5+
COMPOSER_VERSION=2
6+
PHP_VERSION=7.4
67
TRAEFIK_DOMAIN=depends.test
78
TRAEFIK_SUBDOMAIN=app
9+
WARDEN_COMPOSER_DIR=./.composer

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
vendor/
22
composer.lock
3+
.composer/

composer.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
"license": "MIT",
66
"require": {
77
"php": "^7.2",
8-
"composer-plugin-api": "^1.0",
9-
"composer/composer": "^1",
8+
"composer-plugin-api": "^1|^2",
9+
"composer/composer": "^1|^2",
1010
"composer/semver": "^1|^2|^3",
1111
"symfony/console": "^5"
1212
},

src/Command/WhyBlockCommand.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
use Symfony\Component\Console\Output\OutputInterface;
1919

2020
/**
21-
* @dependency composer/composer:^1 Extends BaseCommand
21+
* @dependency composer/composer:^1|^2 Extends BaseCommand
2222
*/
2323
class WhyBlockCommand extends BaseCommand
2424
{

src/Plugin.php

+13-2
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,19 @@
1717
/**
1818
* In charge of registering everything our plugin needs
1919
*
20-
* @dependency composer-plugin-api:^1 Reliant Interfaces
21-
* @dependency composer/composer:^1 Existence of IOInterface and Composer class
20+
* @dependency composer-plugin-api:^1|^2 Reliant Interfaces
21+
* @dependency composer/composer:^1|^2 Existence of IOInterface and Composer class
2222
*/
2323
class Plugin implements PluginInterface, Capable, CommandProvider
2424
{
2525
public function activate(Composer $composer, IOInterface $io): void
2626
{
27+
/* No-op */
28+
}
29+
30+
public function deactivate(Composer $composer, IOInterface $io): void
31+
{
32+
/* No-op */
2733
}
2834

2935
public function getCapabilities(): array
@@ -39,4 +45,9 @@ public function getCommands(): array
3945
new WhyBlockCommand(),
4046
];
4147
}
48+
49+
public function uninstall(Composer $composer, IOInterface $io): void
50+
{
51+
/* No-op */
52+
}
4253
}

0 commit comments

Comments
 (0)