Added root package to ComposerManager->getPackages()
This commit is contained in:
+3
-4
@@ -20,7 +20,6 @@ use Symfony\Component\Console\Application;
|
||||
use LotGD\Core\ {
|
||||
ComposerManager,
|
||||
BootstrapInterface,
|
||||
Exceptions\ArgumentException,
|
||||
Exceptions\InvalidConfigurationException
|
||||
};
|
||||
|
||||
@@ -47,7 +46,7 @@ class Bootstrap
|
||||
public function getGame(): Game
|
||||
{
|
||||
$composer = $this->createComposerManager();
|
||||
$this->bootstrapClasses = $this->getBootstrapClasses($composer);
|
||||
$this->bootstrapClasses = $this->initPackageBootstraps($composer);
|
||||
|
||||
$config = $this->createConfiguration();
|
||||
$logger = $this->createLogger($config, "lotgd");
|
||||
@@ -114,7 +113,7 @@ class Bootstrap
|
||||
* @return array
|
||||
* @throws \Exception
|
||||
*/
|
||||
protected function getBootstrapClasses(ComposerManager $composer): array
|
||||
protected function initPackageBootstraps(ComposerManager $composer): array
|
||||
{
|
||||
$packages = $composer->getPackages();
|
||||
$classes = [];
|
||||
@@ -223,7 +222,7 @@ class Bootstrap
|
||||
*/
|
||||
public function addDaenerysCommands(Application $application)
|
||||
{
|
||||
foreach($this->bootstrapClasses as $bootstrap)
|
||||
foreach ($this->bootstrapClasses as $bootstrap)
|
||||
{
|
||||
$bootstrap->addDaenerysCommand($this->game, $application);
|
||||
}
|
||||
|
||||
@@ -9,5 +9,5 @@ interface BootstrapInterface
|
||||
{
|
||||
public function hasEntityPath(): bool;
|
||||
public function getEntityPath(): string;
|
||||
public function addDaenerysCommand(Application $application);
|
||||
public function addDaenerysCommand(Game $game, Application $application);
|
||||
}
|
||||
@@ -71,7 +71,10 @@ class ComposerManager
|
||||
*/
|
||||
public function getPackages(): array
|
||||
{
|
||||
return $this->getComposer()->getRepositoryManager()->getLocalRepository()->getPackages();
|
||||
return array_merge(
|
||||
[$this->getComposer()->getPackage()],
|
||||
$this->getComposer()->getRepositoryManager()->getLocalRepository()->getPackages()
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -5,6 +5,7 @@ namespace LotGD\Core\Tests\FakeModule;
|
||||
use Symfony\Component\Console\Application;
|
||||
|
||||
use LotGD\Core\BootstrapInterface;
|
||||
use LotGD\Core\Game;
|
||||
|
||||
class Bootstrap implements BootstrapInterface
|
||||
{
|
||||
@@ -18,7 +19,7 @@ class Bootstrap implements BootstrapInterface
|
||||
return __DIR__ . "/Models";
|
||||
}
|
||||
|
||||
public function addDaenerysCommand(Application $application)
|
||||
public function addDaenerysCommand(Game $game, Application $application)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user