diff --git a/src/Plugin.php b/src/Plugin.php index 4bf7388..58c96fa 100644 --- a/src/Plugin.php +++ b/src/Plugin.php @@ -8,6 +8,7 @@ use Composer\Plugin\PluginInterface; use Composer\Script\Event; use Composer\Script\ScriptEvents; +use function file_exists; final class Plugin implements PluginInterface, EventSubscriberInterface { @@ -53,6 +54,12 @@ public static function getSubscribedEvents(): array public function process(Event $event): void { $io = $event->getIO(); + + if (!file_exists(__DIR__)) { + $io->write('phpstan/extension-installer: Package not found (probably scheduled for removal); extensions installation skipped.'); + return; + } + $composer = $event->getComposer(); $installationManager = $composer->getInstallationManager();