X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/cdaad2f40ec96fd98e6320638854c69b90bfe847..refs/pull/3113/head:/app/Theming/ThemeService.php diff --git a/app/Theming/ThemeService.php b/app/Theming/ThemeService.php index f095c7a8e..275dc9d8c 100644 --- a/app/Theming/ThemeService.php +++ b/app/Theming/ThemeService.php @@ -3,17 +3,14 @@ namespace BookStack\Theming; use BookStack\Auth\Access\SocialAuthService; +use Illuminate\Console\Application; +use Illuminate\Console\Application as Artisan; use Symfony\Component\Console\Command\Command; class ThemeService { protected $listeners = []; - /** - * @var Command[] - */ - protected $commands = []; - /** * Listen to a given custom theme event, * setting up the action to be ran when the event occurs. @@ -54,15 +51,9 @@ class ThemeService */ public function registerCommand(Command $command) { - $this->commands[] = $command; - } - - /** - * Get the custom commands that have been registered. - */ - public function getRegisteredCommands(): array - { - return $this->commands; + Artisan::starting(function (Application $application) use ($command) { + $application->addCommands([$command]); + }); } /**