| Total Complexity | 6 |
| Total Lines | 67 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 11 | class Plugin implements PluginInterface, EventSubscriberInterface |
||
| 12 | { |
||
| 13 | /** @var InstallerInterface[] */ |
||
| 14 | private $installers; |
||
| 15 | |||
| 16 | /** |
||
| 17 | * Constructor. |
||
| 18 | * |
||
| 19 | * @param InstallerInterface[] ...$installers |
||
| 20 | */ |
||
| 21 | 1 | public function __construct(InstallerInterface ...$installers) |
|
| 22 | { |
||
| 23 | 1 | $this->installers = $installers; |
|
| 24 | 1 | } |
|
| 25 | |||
| 26 | /** |
||
| 27 | * Apply plugin modifications to Composer. |
||
| 28 | * |
||
| 29 | * @param Composer $composer |
||
| 30 | * @param IOInterface $io |
||
| 31 | * |
||
| 32 | * @return void |
||
| 33 | */ |
||
| 34 | 1 | public function activate(Composer $composer, IOInterface $io) |
|
| 35 | { |
||
| 36 | 1 | $this->addInstallers( |
|
| 37 | 1 | ...include __DIR__ . '/installers.php' |
|
| 38 | ); |
||
| 39 | 1 | } |
|
| 40 | |||
| 41 | /** |
||
| 42 | * Add installers. |
||
| 43 | * |
||
| 44 | * @param InstallerInterface[] ...$installers |
||
| 45 | * |
||
| 46 | * @return void |
||
| 47 | */ |
||
| 48 | 1 | public function addInstallers(InstallerInterface ...$installers) |
|
| 51 | 1 | } |
|
| 52 | |||
| 53 | /** |
||
| 54 | * Run the installers. |
||
| 55 | * |
||
| 56 | * @return void |
||
| 57 | */ |
||
| 58 | 1 | public function install() |
|
| 62 | } |
||
| 63 | 1 | } |
|
| 64 | |||
| 65 | /** |
||
| 66 | * Subscribe to post update and post install command. |
||
| 67 | * |
||
| 68 | * @return array |
||
| 69 | */ |
||
| 70 | 1 | public static function getSubscribedEvents(): array |
|
| 82 |