* Update the "remember me" token for the given user in storage.
*
* @param Authenticatable $user
- * @param string $token
+ * @param string $token
*
* @return void
*/
* Validate a user against the given credentials.
*
* @param Authenticatable $user
- * @param array $credentials
+ * @param array $credentials
*
* @return bool
*/
/**
* Check if this instance or class is a certain type of entity.
* Examples of $type are 'page', 'book', 'chapter'.
+ *
* @deprecated Use instanceof instead.
*/
public static function isA(string $type): bool
interface Deletable
{
public function deletions(): MorphMany;
-}
\ No newline at end of file
+}
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;
*/
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]);
+ });
}
/**
public function test_register_command_allows_provided_command_to_be_usable_via_artisan()
{
- Theme::registerCommand(new MyCustomCommand);
+ Theme::registerCommand(new MyCustomCommand());
Artisan::call('bookstack:test-custom-command', []);
$output = Artisan::output();
}
}
-class MyCustomCommand extends Command {
+class MyCustomCommand extends Command
+{
protected $signature = 'bookstack:test-custom-command';
- public function handle() {
+
+ public function handle()
+ {
$this->line('Command ran!');
}
-}
\ No newline at end of file
+}