25
25
use Composer \Command \BaseCommand ;
26
26
use Composer \Composer ;
27
27
use Composer \Factory ;
28
- use Composer \IO \ConsoleIO ;
29
28
use Composer \IO \IOInterface ;
30
29
use Composer \Plugin \Capability \CommandProvider ;
31
30
use Composer \Plugin \Capable ;
32
31
use Composer \Plugin \PluginInterface ;
33
32
use Ramsey \Dev \Repl \Process \ProcessFactory ;
34
- use Symfony \Component \Console \Helper \DescriptorHelper ;
35
- use Symfony \Component \Console \Helper \FormatterHelper ;
36
- use Symfony \Component \Console \Helper \HelperSet ;
37
- use Symfony \Component \Console \Helper \ProcessHelper ;
38
- use Symfony \Component \Console \Helper \SymfonyQuestionHelper ;
39
- use Symfony \Component \Console \Input \StringInput ;
40
- use Symfony \Component \Console \Output \ConsoleOutput ;
41
33
42
34
use function realpath ;
43
35
@@ -48,34 +40,13 @@ class ReplPlugin implements Capable, CommandProvider, PluginInterface
48
40
{
49
41
private ProcessFactory $ processFactory ;
50
42
private string $ repoRoot ;
51
- private Composer $ composer ;
52
43
53
- /**
54
- * @var mixed[]
55
- */
56
- private array $ capabilityArgs = [];
57
-
58
- /**
59
- * Composer\Plugin\PluginManager::getPluginCapability() passes an array to
60
- * the constructor of the capability class, which is this class. We don't
61
- * use this argument, but it's provided here to avoid errors.
62
- *
63
- * @link https://github.com/composer/composer/blob/a5e608fb73f8eeff8f3acc6fb938c15e5310efcb/src/Composer/Plugin/PluginManager.php#L473-L474
64
- *
65
- * @param mixed[] $args
66
- */
67
- public function __construct (
68
- array $ args = [],
69
- ?Composer $ composer = null ,
70
- ?IOInterface $ io = null ,
71
- ?ProcessFactory $ processFactory = null
72
- ) {
44
+ public function __construct ()
45
+ {
73
46
$ composerFile = (string ) Factory::getComposerFile ();
74
47
75
- $ this ->capabilityArgs = $ args ;
76
48
$ this ->repoRoot = (string ) realpath (dirname ($ composerFile ));
77
- $ this ->processFactory = $ processFactory ?? new ProcessFactory ();
78
- $ this ->composer = $ composer ?? Factory::create ($ io ?? $ this ->buildIO (), $ composerFile );
49
+ $ this ->processFactory = new ProcessFactory ();
79
50
}
80
51
81
52
/**
@@ -109,19 +80,4 @@ public function deactivate(Composer $composer, IOInterface $io): void
109
80
public function uninstall (Composer $ composer , IOInterface $ io ): void
110
81
{
111
82
}
112
-
113
- private function buildIO (): ConsoleIO
114
- {
115
- $ input = new StringInput ('' );
116
- $ output = new ConsoleOutput ();
117
-
118
- $ helperSet = new HelperSet ([
119
- new DescriptorHelper (),
120
- new FormatterHelper (),
121
- new ProcessHelper (),
122
- new SymfonyQuestionHelper (),
123
- ]);
124
-
125
- return new ConsoleIO ($ input , $ output , $ helperSet );
126
- }
127
83
}
0 commit comments