Skip to content

Commit

Permalink
fix erros with composer commands
Browse files Browse the repository at this point in the history
Signed-off-by: kpicaza <1093654+kpicaza@users.noreply.github.com>
  • Loading branch information
kpicaza authored and weierophinney committed Oct 27, 2020
1 parent 19d2b54 commit dfbeb77
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/ComponentInstaller.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,9 @@ public function activate(Composer $composer, IOInterface $io)
$this->composer = $composer;
$this->io = $io;
$this->cachedInjectors = [];
$this->packageProviderFactory = PackageProviderDetectionFactory::create($composer);
$this->packageProviderFactory = function () {
return PackageProviderDetectionFactory::create($this->composer);
};
}

/**
Expand Down Expand Up @@ -219,6 +221,10 @@ public function onPostPackageInstall(PackageEvent $event)
return;
}

$this->packageProviderFactory = is_callable($this->packageProviderFactory)
? ($this->packageProviderFactory)()
: $this->packageProviderFactory;

$packageProviderDetection = $this->packageProviderFactory->detect($event, $name);
$requireDev = $this->isADevDependency($packageProviderDetection, $package);
$dependencies = $this->loadModuleClassesDependencies($package);
Expand Down

0 comments on commit dfbeb77

Please sign in to comment.