]> BookStack Code Mirror - bookstack/blobdiff - app/Console/Commands/RegenerateReferences.php
Aligned command class code
[bookstack] / app / Console / Commands / RegenerateReferences.php
index 805fd922d8e4e680b3c3b73e284669cb39b2f08f..f85e0cd4082b7f438a2591e413f692835360d19b 100644 (file)
@@ -13,7 +13,8 @@ class RegenerateReferences extends Command
      *
      * @var string
      */
-    protected $signature = 'bookstack:regenerate-references {--database= : The database connection to use.}';
+    protected $signature = 'bookstack:regenerate-references
+                            {--database= : The database connection to use}';
 
     /**
      * The console command description.
@@ -22,25 +23,10 @@ class RegenerateReferences extends Command
      */
     protected $description = 'Regenerate all the cross-item model reference index';
 
-    protected ReferenceStore $references;
-
-    /**
-     * Create a new command instance.
-     *
-     * @return void
-     */
-    public function __construct(ReferenceStore $references)
-    {
-        $this->references = $references;
-        parent::__construct();
-    }
-
     /**
      * Execute the console command.
-     *
-     * @return int
      */
-    public function handle()
+    public function handle(ReferenceStore $references): int
     {
         $connection = DB::getDefaultConnection();
 
@@ -48,7 +34,7 @@ class RegenerateReferences extends Command
             DB::setDefaultConnection($this->option('database'));
         }
 
-        $this->references->updateForAllPages();
+        $references->updateForAllPages();
 
         DB::setDefaultConnection($connection);