]> BookStack Code Mirror - bookstack/blobdiff - app/Theming/ThemeService.php
Tweaked custom command registration, Added StyleCI fixes
[bookstack] / app / Theming / ThemeService.php
index f0f8f033c4d9c4542259906835cb1bf98d4651a3..7bc12c5d1561f5e1463b8ff52dea935b7b78e0e4 100644 (file)
@@ -3,6 +3,8 @@
 namespace BookStack\Theming;
 
 use BookStack\Auth\Access\SocialAuthService;
+use Illuminate\Console\Application;
+use Illuminate\Console\Application as Artisan;
 use Illuminate\Contracts\Console\Kernel;
 use Symfony\Component\Console\Command\Command;
 
@@ -50,9 +52,9 @@ class ThemeService
      */
     public function registerCommand(Command $command)
     {
-        /** @var \Illuminate\Foundation\Console\Kernel $consoleKernel */
-        $consoleKernel = app()->make(Kernel::class);
-        $consoleKernel->registerCommand($command);
+        Artisan::starting(function(Application $application) use ($command) {
+            $application->addCommands([$command]);
+        });
     }
 
     /**