Total Complexity | 6 |
Total Lines | 48 |
Duplicated Lines | 0 % |
Coverage | 72.72% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
15 | final class Plugin implements EventSubscriberInterface, PluginInterface |
||
16 | { |
||
17 | /** |
||
18 | * {@inheritdoc} |
||
19 | */ |
||
20 | public function activate(Composer $composer, IOInterface $io): void |
||
21 | { |
||
22 | } |
||
23 | |||
24 | /** |
||
25 | * @return array<string, string> |
||
26 | */ |
||
27 | public static function getSubscribedEvents(): array |
||
30 | 1 | } |
|
31 | |||
32 | 1 | /** |
|
33 | * @param Event $composerEvent |
||
34 | * |
||
35 | * @throws ReflectionException |
||
36 | */ |
||
37 | public static function regeneration(Event $composerEvent): void |
||
38 | { |
||
39 | // This is to prevent issue when removing the package with composer. |
||
40 | 2 | if (false === class_exists(ClassGenerator::class)) { |
|
41 | return; |
||
42 | } |
||
43 | 2 | ||
44 | $composerEvent->getIO()->write('<info>drupol/composer-packages:</info> Regenerating classes...'); |
||
45 | |||
46 | (new ClassGenerator($composerEvent))->regenerateClasses(); |
||
47 | 2 | ||
48 | $composerEvent->getIO()->write('<info>drupol/composer-packages:</info> Done.'); |
||
49 | 2 | } |
|
50 | |||
51 | 2 | public function deactivate(Composer $composer, IOInterface $io) |
|
53 | } |
||
54 | |||
55 | public function uninstall(Composer $composer, IOInterface $io) |
||
63 | ) |
||
64 | ) |
||
65 | ); |
||
68 |