mirror of
https://github.com/flarum/framework.git
synced 2024-11-24 17:12:13 +08:00
Get rid of some repetition
This commit is contained in:
parent
7e33690660
commit
238f2fca73
|
@ -11,7 +11,12 @@
|
|||
|
||||
namespace Flarum\Console;
|
||||
|
||||
use Flarum\Console\Command\GenerateExtensionCommand;
|
||||
use Flarum\Console\Command\GenerateMigrationCommand;
|
||||
use Flarum\Debug\Console\InfoCommand;
|
||||
use Flarum\Foundation\AbstractServer;
|
||||
use Flarum\Install\Console\InstallCommand;
|
||||
use Flarum\Update\Console\MigrateCommand;
|
||||
use Symfony\Component\Console\Application;
|
||||
|
||||
class Server extends AbstractServer
|
||||
|
@ -29,16 +34,21 @@ class Server extends AbstractServer
|
|||
protected function getConsoleApplication()
|
||||
{
|
||||
$app = $this->getApp();
|
||||
|
||||
$console = new Application('Flarum', $app->version());
|
||||
|
||||
$app->register('Flarum\Install\InstallServiceProvider');
|
||||
|
||||
$console->add($app->make('Flarum\Install\Console\InstallCommand'));
|
||||
$console->add($app->make('Flarum\Update\Console\MigrateCommand'));
|
||||
$console->add($app->make('Flarum\Debug\Console\InfoCommand'));
|
||||
$console->add($app->make('Flarum\Console\Command\GenerateExtensionCommand'));
|
||||
$console->add($app->make('Flarum\Console\Command\GenerateMigrationCommand'));
|
||||
$commands = [
|
||||
InstallCommand::class,
|
||||
MigrateCommand::class,
|
||||
InfoCommand::class,
|
||||
GenerateExtensionCommand::class,
|
||||
GenerateMigrationCommand::class,
|
||||
];
|
||||
|
||||
foreach ($commands as $command) {
|
||||
$console->add($app->make($command));
|
||||
}
|
||||
|
||||
return $console;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user