]> BookStack Code Mirror - bookstack/blobdiff - app/Theming/ThemeService.php
Added test for logical-theme-system command registration
[bookstack] / app / Theming / ThemeService.php
index f095c7a8e7fb1716d4caa77495887acd2e51f898..f0f8f033c4d9c4542259906835cb1bf98d4651a3 100644 (file)
@@ -3,17 +3,13 @@
 namespace BookStack\Theming;
 
 use BookStack\Auth\Access\SocialAuthService;
+use Illuminate\Contracts\Console\Kernel;
 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 +50,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;
+        /** @var \Illuminate\Foundation\Console\Kernel $consoleKernel */
+        $consoleKernel = app()->make(Kernel::class);
+        $consoleKernel->registerCommand($command);
     }
 
     /**