diff --git a/src/Console/CastMakeCommand.php b/src/Console/CastMakeCommand.php index 7b2b0b3..d6491c8 100644 --- a/src/Console/CastMakeCommand.php +++ b/src/Console/CastMakeCommand.php @@ -35,6 +35,7 @@ public function __construct(Filesystem $files) * * @throws \Illuminate\Contracts\Filesystem\FileNotFoundException */ + #[\Override] public function handle() { return $this->generateCode() ? self::SUCCESS : self::FAILURE; @@ -46,6 +47,7 @@ public function handle() * @param string $name * @return string */ + #[\Override] protected function getPath($name) { return $this->getPathUsingCanvas($name); @@ -56,6 +58,7 @@ protected function getPath($name) * * @return string */ + #[\Override] protected function rootNamespace() { return $this->rootNamespaceUsingCanvas(); diff --git a/src/Console/ChannelMakeCommand.php b/src/Console/ChannelMakeCommand.php index 6bcbd29..dc5cf6f 100644 --- a/src/Console/ChannelMakeCommand.php +++ b/src/Console/ChannelMakeCommand.php @@ -37,6 +37,7 @@ public function __construct(Filesystem $files) * * @throws \Illuminate\Contracts\Filesystem\FileNotFoundException */ + #[\Override] public function handle() { return $this->generateCode() ? self::SUCCESS : self::FAILURE; @@ -48,6 +49,7 @@ public function handle() * @param string $name * @return string */ + #[\Override] protected function getPath($name) { return $this->getPathUsingCanvas($name); @@ -58,6 +60,7 @@ protected function getPath($name) * * @return string */ + #[\Override] protected function rootNamespace() { return $this->rootNamespaceUsingCanvas(); diff --git a/src/Console/CodeMakeCommand.php b/src/Console/CodeMakeCommand.php index f12b0d5..3d4ca70 100644 --- a/src/Console/CodeMakeCommand.php +++ b/src/Console/CodeMakeCommand.php @@ -22,6 +22,7 @@ class CodeMakeCommand extends GeneratorCommand * * @return string */ + #[\Override] protected function getStub() { return $this->resolveStubPath('/stubs/class.stub'); @@ -43,6 +44,7 @@ protected function resolveDefaultStubPath($stub) * * @return array */ + #[\Override] protected function getOptions() { return [ diff --git a/src/Console/Commander.php b/src/Console/Commander.php index 12c09ea..6e076c3 100644 --- a/src/Console/Commander.php +++ b/src/Console/Commander.php @@ -37,6 +37,7 @@ protected function resolveApplicationCallback() * * @return \Illuminate\Foundation\Application */ + #[\Override] public function laravel() { if (! $this->app instanceof LaravelApplication) { diff --git a/src/Console/ComponentMakeCommand.php b/src/Console/ComponentMakeCommand.php index 48b762e..467d4f4 100644 --- a/src/Console/ComponentMakeCommand.php +++ b/src/Console/ComponentMakeCommand.php @@ -35,6 +35,7 @@ public function __construct(Filesystem $files) * * @throws \Illuminate\Contracts\Filesystem\FileNotFoundException */ + #[\Override] public function handle() { return $this->generateCode() ? self::SUCCESS : self::FAILURE; @@ -58,6 +59,7 @@ public function afterCodeHasBeenGenerated(string $className, string $path): void * @param string $name * @return string */ + #[\Override] protected function getPath($name) { return $this->getPathUsingCanvas($name); @@ -68,6 +70,7 @@ protected function getPath($name) * * @return string */ + #[\Override] protected function rootNamespace() { return $this->rootNamespaceUsingCanvas(); @@ -79,6 +82,7 @@ protected function rootNamespace() * @param string $path * @return string */ + #[\Override] protected function viewPath($path = '') { return $this->viewPathUsingCanvas($path); diff --git a/src/Console/ConsoleMakeCommand.php b/src/Console/ConsoleMakeCommand.php index 9f6524d..dc00552 100644 --- a/src/Console/ConsoleMakeCommand.php +++ b/src/Console/ConsoleMakeCommand.php @@ -37,6 +37,7 @@ public function __construct(Filesystem $files) * * @throws \Illuminate\Contracts\Filesystem\FileNotFoundException */ + #[\Override] public function handle() { return $this->generateCode() ? self::SUCCESS : self::FAILURE; @@ -48,6 +49,7 @@ public function handle() * @param string $name * @return string */ + #[\Override] protected function getPath($name) { return $this->getPathUsingCanvas($name); @@ -58,6 +60,7 @@ protected function getPath($name) * * @return string */ + #[\Override] protected function rootNamespace() { return $this->rootNamespaceUsingCanvas(); @@ -69,6 +72,7 @@ protected function rootNamespace() * @param string $rootNamespace * @return string */ + #[\Override] protected function getDefaultNamespace($rootNamespace) { return rtrim($this->generatorPreset()->commandNamespace(), '\\'); diff --git a/src/Console/ControllerMakeCommand.php b/src/Console/ControllerMakeCommand.php index 6d05d31..adb812b 100644 --- a/src/Console/ControllerMakeCommand.php +++ b/src/Console/ControllerMakeCommand.php @@ -37,6 +37,7 @@ public function __construct(Filesystem $files) * * @throws \Illuminate\Contracts\Filesystem\FileNotFoundException */ + #[\Override] public function handle() { return $this->generateCode() ? self::SUCCESS : self::FAILURE; @@ -48,6 +49,7 @@ public function handle() * @param string $model * @return string */ + #[\Override] protected function qualifyModel(string $model) { return $this->qualifyModelUsingCanvas($model); @@ -58,6 +60,7 @@ protected function qualifyModel(string $model) * * @return array */ + #[\Override] protected function buildParentReplacements() { $parentModelClass = $this->parseModel($this->option('parent')); @@ -86,6 +89,7 @@ protected function buildParentReplacements() * @param array $replace * @return array */ + #[\Override] protected function buildModelReplacements(array $replace) { $modelClass = $this->parseModel($this->option('model')); @@ -115,6 +119,7 @@ protected function buildModelReplacements(array $replace) * @param string $name * @return string */ + #[\Override] protected function getPath($name) { return $this->getPathUsingCanvas($name); @@ -125,6 +130,7 @@ protected function getPath($name) * * @return string */ + #[\Override] protected function rootNamespace() { return $this->rootNamespaceUsingCanvas(); diff --git a/src/Console/EventMakeCommand.php b/src/Console/EventMakeCommand.php index d69b680..bf44bc7 100644 --- a/src/Console/EventMakeCommand.php +++ b/src/Console/EventMakeCommand.php @@ -35,6 +35,7 @@ public function __construct(Filesystem $files) * * @throws \Illuminate\Contracts\Filesystem\FileNotFoundException */ + #[\Override] public function handle() { return $this->generateCode() ? self::SUCCESS : self::FAILURE; @@ -46,6 +47,7 @@ public function handle() * @param string $name * @return string */ + #[\Override] protected function getPath($name) { return $this->getPathUsingCanvas($name); @@ -56,6 +58,7 @@ protected function getPath($name) * * @return string */ + #[\Override] protected function rootNamespace() { return $this->rootNamespaceUsingCanvas(); diff --git a/src/Console/ExceptionMakeCommand.php b/src/Console/ExceptionMakeCommand.php index 1a41532..2393af3 100644 --- a/src/Console/ExceptionMakeCommand.php +++ b/src/Console/ExceptionMakeCommand.php @@ -35,6 +35,7 @@ public function __construct(Filesystem $files) * * @throws \Illuminate\Contracts\Filesystem\FileNotFoundException */ + #[\Override] public function handle() { return $this->generateCode() ? self::SUCCESS : self::FAILURE; @@ -46,6 +47,7 @@ public function handle() * @param string $name * @return string */ + #[\Override] protected function getPath($name) { return $this->getPathUsingCanvas($name); @@ -56,6 +58,7 @@ protected function getPath($name) * * @return string */ + #[\Override] protected function rootNamespace() { return $this->rootNamespaceUsingCanvas(); diff --git a/src/Console/FactoryMakeCommand.php b/src/Console/FactoryMakeCommand.php index 2dcb792..1fdc9de 100644 --- a/src/Console/FactoryMakeCommand.php +++ b/src/Console/FactoryMakeCommand.php @@ -37,6 +37,7 @@ public function __construct(Filesystem $files) * * @throws \Illuminate\Contracts\Filesystem\FileNotFoundException */ + #[\Override] public function handle() { return $this->generateCode() ? self::SUCCESS : self::FAILURE; @@ -59,6 +60,7 @@ protected function resolveDefaultStubPath($stub) * @param string $name * @return string */ + #[\Override] protected function getNamespace($name) { return rtrim($this->generatorPreset()->factoryNamespace(), '\\'); @@ -78,6 +80,7 @@ protected function getGeneratorSourcePath(): string * @param string $name * @return string */ + #[\Override] protected function guessModelName($name) { if (str_ends_with($name, 'Factory')) { @@ -93,6 +96,7 @@ protected function guessModelName($name) * @param string $name * @return string */ + #[\Override] protected function getPath($name) { return $this->getPathUsingCanvas($name); @@ -103,6 +107,7 @@ protected function getPath($name) * * @return string */ + #[\Override] protected function rootNamespace() { return $this->rootNamespaceUsingCanvas(); @@ -113,6 +118,7 @@ protected function rootNamespace() * * @return string|null */ + #[\Override] protected function userProviderModel() { return $this->userProviderModelUsingCanvas(); diff --git a/src/Console/FailedTableCommand.php b/src/Console/FailedTableCommand.php index 432cf6b..3810419 100644 --- a/src/Console/FailedTableCommand.php +++ b/src/Console/FailedTableCommand.php @@ -35,6 +35,7 @@ public function __construct(Filesystem $files, Composer $composer) * @param string $table * @return string */ + #[\Override] protected function createBaseMigration($table = 'failed_jobs') { return $this->createBaseMigrationUsingCanvas($table); diff --git a/src/Console/GeneratorMakeCommand.php b/src/Console/GeneratorMakeCommand.php index 8a3f669..de1e213 100644 --- a/src/Console/GeneratorMakeCommand.php +++ b/src/Console/GeneratorMakeCommand.php @@ -27,6 +27,7 @@ class GeneratorMakeCommand extends GeneratorCommand * @param string $name * @return string */ + #[\Override] protected function replaceClass($stub, $name) { $stub = parent::replaceClass($stub, $name); @@ -42,6 +43,7 @@ protected function replaceClass($stub, $name) * * @return string */ + #[\Override] protected function getStub() { return $this->resolveStubPath('/stubs/generator.stub'); @@ -64,6 +66,7 @@ protected function resolveDefaultStubPath($stub) * @param string $rootNamespace * @return string */ + #[\Override] protected function getDefaultNamespace($rootNamespace) { return rtrim($this->generatorPreset()->commandNamespace(), '\\'); @@ -74,6 +77,7 @@ protected function getDefaultNamespace($rootNamespace) * * @return array */ + #[\Override] protected function getOptions() { return [ diff --git a/src/Console/JobMakeCommand.php b/src/Console/JobMakeCommand.php index 36b9c22..186e5ad 100644 --- a/src/Console/JobMakeCommand.php +++ b/src/Console/JobMakeCommand.php @@ -37,6 +37,7 @@ public function __construct(Filesystem $files) * * @throws \Illuminate\Contracts\Filesystem\FileNotFoundException */ + #[\Override] public function handle() { return $this->generateCode() ? self::SUCCESS : self::FAILURE; @@ -48,6 +49,7 @@ public function handle() * @param string $name * @return string */ + #[\Override] protected function getPath($name) { return $this->getPathUsingCanvas($name); @@ -58,6 +60,7 @@ protected function getPath($name) * * @return string */ + #[\Override] protected function rootNamespace() { return $this->rootNamespaceUsingCanvas(); diff --git a/src/Console/ListenerMakeCommand.php b/src/Console/ListenerMakeCommand.php index d1ff512..0f70ed4 100644 --- a/src/Console/ListenerMakeCommand.php +++ b/src/Console/ListenerMakeCommand.php @@ -37,6 +37,7 @@ public function __construct(Filesystem $files) * * @throws \Illuminate\Contracts\Filesystem\FileNotFoundException */ + #[\Override] public function handle() { return $this->generateCode() ? self::SUCCESS : self::FAILURE; @@ -48,6 +49,7 @@ public function handle() * @param string $name * @return string */ + #[\Override] protected function getPath($name) { return $this->getPathUsingCanvas($name); @@ -58,6 +60,7 @@ protected function getPath($name) * * @return string */ + #[\Override] protected function rootNamespace() { return $this->rootNamespaceUsingCanvas(); diff --git a/src/Console/MailMakeCommand.php b/src/Console/MailMakeCommand.php index 363aacb..91d7cb9 100644 --- a/src/Console/MailMakeCommand.php +++ b/src/Console/MailMakeCommand.php @@ -37,6 +37,7 @@ public function __construct(Filesystem $files) * * @throws \Illuminate\Contracts\Filesystem\FileNotFoundException */ + #[\Override] public function handle() { return $this->generateCode() ? self::SUCCESS : self::FAILURE; @@ -58,6 +59,7 @@ public function afterCodeHasBeenGenerated(string $className, string $path): void * @param string $name * @return string */ + #[\Override] protected function getPath($name) { return $this->getPathUsingCanvas($name); @@ -68,6 +70,7 @@ protected function getPath($name) * * @return string */ + #[\Override] protected function rootNamespace() { return $this->rootNamespaceUsingCanvas(); diff --git a/src/Console/MiddlewareMakeCommand.php b/src/Console/MiddlewareMakeCommand.php index f1010e4..ec54f2f 100644 --- a/src/Console/MiddlewareMakeCommand.php +++ b/src/Console/MiddlewareMakeCommand.php @@ -37,6 +37,7 @@ public function __construct(Filesystem $files) * * @throws \Illuminate\Contracts\Filesystem\FileNotFoundException */ + #[\Override] public function handle() { return $this->generateCode() ? self::SUCCESS : self::FAILURE; @@ -48,6 +49,7 @@ public function handle() * @param string $name * @return string */ + #[\Override] protected function getPath($name) { return $this->getPathUsingCanvas($name); @@ -58,6 +60,7 @@ protected function getPath($name) * * @return string */ + #[\Override] protected function rootNamespace() { return $this->rootNamespaceUsingCanvas(); diff --git a/src/Console/MigrateMakeCommand.php b/src/Console/MigrateMakeCommand.php index b5d1b81..d11f5ef 100644 --- a/src/Console/MigrateMakeCommand.php +++ b/src/Console/MigrateMakeCommand.php @@ -42,6 +42,7 @@ public function __construct(MigrationCreator $creator, Composer $composer) * * @return void */ + #[\Override] public function handle() { $preset = $this->generatorPreset(); diff --git a/src/Console/ModelMakeCommand.php b/src/Console/ModelMakeCommand.php index 342cef1..2621583 100644 --- a/src/Console/ModelMakeCommand.php +++ b/src/Console/ModelMakeCommand.php @@ -38,11 +38,15 @@ public function __construct(Filesystem $files) * * @throws \Illuminate\Contracts\Filesystem\FileNotFoundException */ + #[\Override] public function handle() { return $this->generateCode() ? self::SUCCESS : self::FAILURE; } + /** + * Run after code successfully generated. + */ protected function afterCodeHasBeenGenerated(): void { if ($this->option('all')) { @@ -80,6 +84,7 @@ protected function afterCodeHasBeenGenerated(): void * * @return void */ + #[\Override] protected function createFactory() { $factory = Str::studly($this->getNameInput()); @@ -95,6 +100,7 @@ protected function createFactory() * * @return void */ + #[\Override] protected function createMigration() { $table = Str::snake(Str::pluralStudly(class_basename($this->getNameInput()))); @@ -116,6 +122,7 @@ protected function createMigration() * * @return void */ + #[\Override] protected function createSeeder() { $seeder = Str::studly(class_basename($this->getNameInput())); @@ -131,6 +138,7 @@ protected function createSeeder() * * @return void */ + #[\Override] protected function createController() { $controller = Str::studly(class_basename($this->getNameInput())); @@ -151,6 +159,7 @@ protected function createController() * * @return void */ + #[\Override] protected function createPolicy() { $policy = Str::studly(class_basename($this->getNameInput())); @@ -168,6 +177,7 @@ protected function createPolicy() * @param string $rootNamespace * @return string */ + #[\Override] protected function getDefaultNamespace($rootNamespace) { return rtrim($this->generatorPreset()->modelNamespace(), '\\'); @@ -179,6 +189,7 @@ protected function getDefaultNamespace($rootNamespace) * @param string $model * @return string */ + #[\Override] protected function qualifyModel(string $model) { return $this->qualifyModelUsingCanvas($model); @@ -190,6 +201,7 @@ protected function qualifyModel(string $model) * @param string $name * @return string */ + #[\Override] protected function getPath($name) { return $this->getPathUsingCanvas($name); @@ -200,6 +212,7 @@ protected function getPath($name) * * @return string */ + #[\Override] protected function rootNamespace() { return $this->rootNamespaceUsingCanvas(); diff --git a/src/Console/NotificationMakeCommand.php b/src/Console/NotificationMakeCommand.php index 3e02b38..d3c4bdb 100644 --- a/src/Console/NotificationMakeCommand.php +++ b/src/Console/NotificationMakeCommand.php @@ -37,6 +37,7 @@ public function __construct(Filesystem $files) * * @throws \Illuminate\Contracts\Filesystem\FileNotFoundException */ + #[\Override] public function handle() { return $this->generateCode() ? self::SUCCESS : self::FAILURE; @@ -58,6 +59,7 @@ public function afterCodeHasBeenGenerated(string $className, string $path): void * @param string $name * @return string */ + #[\Override] protected function getPath($name) { return $this->getPathUsingCanvas($name); @@ -68,6 +70,7 @@ protected function getPath($name) * * @return string */ + #[\Override] protected function rootNamespace() { return $this->rootNamespaceUsingCanvas(); diff --git a/src/Console/NotificationTableCommand.php b/src/Console/NotificationTableCommand.php index f238d8b..f1d7155 100644 --- a/src/Console/NotificationTableCommand.php +++ b/src/Console/NotificationTableCommand.php @@ -34,6 +34,7 @@ public function __construct(Filesystem $files, Composer $composer) * * @return string */ + #[\Override] protected function createBaseMigration() { return $this->createBaseMigrationUsingCanvas('notifications'); diff --git a/src/Console/ObserverMakeCommand.php b/src/Console/ObserverMakeCommand.php index 44ef148..bd44927 100644 --- a/src/Console/ObserverMakeCommand.php +++ b/src/Console/ObserverMakeCommand.php @@ -35,6 +35,7 @@ public function __construct(Filesystem $files) * * @throws \Illuminate\Contracts\Filesystem\FileNotFoundException */ + #[\Override] public function handle() { return $this->generateCode() ? self::SUCCESS : self::FAILURE; @@ -46,6 +47,7 @@ public function handle() * @param string $model * @return string */ + #[\Override] protected function qualifyModel(string $model) { return $this->qualifyModelUsingCanvas($model); @@ -57,6 +59,7 @@ protected function qualifyModel(string $model) * @param string $name * @return string */ + #[\Override] protected function getPath($name) { return $this->getPathUsingCanvas($name); @@ -67,6 +70,7 @@ protected function getPath($name) * * @return string */ + #[\Override] protected function rootNamespace() { return $this->rootNamespaceUsingCanvas(); diff --git a/src/Console/PolicyMakeCommand.php b/src/Console/PolicyMakeCommand.php index 4b2d87d..22c538e 100644 --- a/src/Console/PolicyMakeCommand.php +++ b/src/Console/PolicyMakeCommand.php @@ -35,6 +35,7 @@ public function __construct(Filesystem $files) * * @throws \Illuminate\Contracts\Filesystem\FileNotFoundException */ + #[\Override] public function handle() { return $this->generateCode() ? self::SUCCESS : self::FAILURE; @@ -46,6 +47,7 @@ public function handle() * @param string $model * @return string */ + #[\Override] protected function qualifyModel(string $model) { return $this->qualifyModelUsingCanvas($model); @@ -57,6 +59,7 @@ protected function qualifyModel(string $model) * @param string $name * @return string */ + #[\Override] protected function getPath($name) { return $this->getPathUsingCanvas($name); @@ -67,6 +70,7 @@ protected function getPath($name) * * @return string */ + #[\Override] protected function rootNamespace() { return $this->rootNamespaceUsingCanvas(); @@ -77,6 +81,7 @@ protected function rootNamespace() * * @return string|null */ + #[\Override] protected function userProviderModel() { /** @var string|null $guard */ diff --git a/src/Console/PresetMakeCommand.php b/src/Console/PresetMakeCommand.php index 9070244..99bb8b7 100644 --- a/src/Console/PresetMakeCommand.php +++ b/src/Console/PresetMakeCommand.php @@ -28,6 +28,7 @@ class PresetMakeCommand extends GeneratorCommand * * @return string */ + #[\Override] protected function getStub() { $name = Str::lower($this->getNameInput()); @@ -45,6 +46,7 @@ protected function getStub() * @param string $name * @return string */ + #[\Override] protected function getPath($name) { return $this->generatorPreset()->basePath().'/canvas.yaml'; @@ -53,6 +55,7 @@ protected function getPath($name) /** * Get the root namespace for the class. */ + #[\Override] protected function rootNamespace(): string { $namespace = transform($this->option('namespace'), function (string $namespace) { @@ -77,6 +80,7 @@ protected function rootNamespace(): string * * @return array */ + #[\Override] protected function getOptions() { return [ diff --git a/src/Console/ProviderMakeCommand.php b/src/Console/ProviderMakeCommand.php index e7a71ea..41ba026 100644 --- a/src/Console/ProviderMakeCommand.php +++ b/src/Console/ProviderMakeCommand.php @@ -35,6 +35,7 @@ public function __construct(Filesystem $files) * * @throws \Illuminate\Contracts\Filesystem\FileNotFoundException */ + #[\Override] public function handle() { return $this->generateCode() ? self::SUCCESS : self::FAILURE; @@ -46,6 +47,7 @@ public function handle() * @param string $name * @return string */ + #[\Override] protected function getPath($name) { return $this->getPathUsingCanvas($name); @@ -56,6 +58,7 @@ protected function getPath($name) * * @return string */ + #[\Override] protected function rootNamespace() { return $this->rootNamespaceUsingCanvas(); @@ -67,6 +70,7 @@ protected function rootNamespace() * @param string $rootNamespace * @return string */ + #[\Override] protected function getDefaultNamespace($rootNamespace) { return rtrim($this->generatorPreset()->providerNamespace(), '\\'); diff --git a/src/Console/QueueTableCommand.php b/src/Console/QueueTableCommand.php index ed856fa..27083ab 100644 --- a/src/Console/QueueTableCommand.php +++ b/src/Console/QueueTableCommand.php @@ -36,6 +36,7 @@ public function __construct(Filesystem $files, Composer $composer) * @param string $table * @return string */ + #[\Override] protected function createBaseMigration($table = 'jobs') { return $this->createBaseMigrationUsingCanvas($table); diff --git a/src/Console/RequestMakeCommand.php b/src/Console/RequestMakeCommand.php index 820f367..6c4eddc 100644 --- a/src/Console/RequestMakeCommand.php +++ b/src/Console/RequestMakeCommand.php @@ -35,6 +35,7 @@ public function __construct(Filesystem $files) * * @throws \Illuminate\Contracts\Filesystem\FileNotFoundException */ + #[\Override] public function handle() { return $this->generateCode() ? self::SUCCESS : self::FAILURE; @@ -46,6 +47,7 @@ public function handle() * @param string $name * @return string */ + #[\Override] protected function getPath($name) { return $this->getPathUsingCanvas($name); @@ -56,6 +58,7 @@ protected function getPath($name) * * @return string */ + #[\Override] protected function rootNamespace() { return $this->rootNamespaceUsingCanvas(); diff --git a/src/Console/ResourceMakeCommand.php b/src/Console/ResourceMakeCommand.php index ab69423..e44d634 100644 --- a/src/Console/ResourceMakeCommand.php +++ b/src/Console/ResourceMakeCommand.php @@ -35,6 +35,7 @@ public function __construct(Filesystem $files) * * @throws \Illuminate\Contracts\Filesystem\FileNotFoundException */ + #[\Override] public function handle() { return $this->generateCode() ? self::SUCCESS : self::FAILURE; @@ -46,6 +47,7 @@ public function handle() * @param string $name * @return string */ + #[\Override] protected function getPath($name) { return $this->getPathUsingCanvas($name); @@ -56,6 +58,7 @@ protected function getPath($name) * * @return string */ + #[\Override] protected function rootNamespace() { return $this->rootNamespaceUsingCanvas(); diff --git a/src/Console/RuleMakeCommand.php b/src/Console/RuleMakeCommand.php index 4881c29..473db56 100644 --- a/src/Console/RuleMakeCommand.php +++ b/src/Console/RuleMakeCommand.php @@ -35,6 +35,7 @@ public function __construct(Filesystem $files) * * @throws \Illuminate\Contracts\Filesystem\FileNotFoundException */ + #[\Override] public function handle() { return $this->generateCode() ? self::SUCCESS : self::FAILURE; @@ -46,6 +47,7 @@ public function handle() * @param string $name * @return string */ + #[\Override] protected function getPath($name) { return $this->getPathUsingCanvas($name); @@ -56,6 +58,7 @@ protected function getPath($name) * * @return string */ + #[\Override] protected function rootNamespace() { return $this->rootNamespaceUsingCanvas(); diff --git a/src/Console/ScopeMakeCommand.php b/src/Console/ScopeMakeCommand.php index 2b30066..88f6d3e 100644 --- a/src/Console/ScopeMakeCommand.php +++ b/src/Console/ScopeMakeCommand.php @@ -35,6 +35,7 @@ public function __construct(Filesystem $files) * * @throws \Illuminate\Contracts\Filesystem\FileNotFoundException */ + #[\Override] public function handle() { return $this->generateCode() ? self::SUCCESS : self::FAILURE; @@ -46,6 +47,7 @@ public function handle() * @param string $model * @return string */ + #[\Override] protected function qualifyModel(string $model) { return $this->qualifyModelUsingCanvas($model); @@ -57,6 +59,7 @@ protected function qualifyModel(string $model) * @param string $name * @return string */ + #[\Override] protected function getPath($name) { return $this->getPathUsingCanvas($name); @@ -67,6 +70,7 @@ protected function getPath($name) * * @return string */ + #[\Override] protected function rootNamespace() { return $this->rootNamespaceUsingCanvas(); diff --git a/src/Console/SeederMakeCommand.php b/src/Console/SeederMakeCommand.php index 36a25ec..3d3af4b 100644 --- a/src/Console/SeederMakeCommand.php +++ b/src/Console/SeederMakeCommand.php @@ -35,6 +35,7 @@ public function __construct(Filesystem $files) * * @throws \Illuminate\Contracts\Filesystem\FileNotFoundException */ + #[\Override] public function handle() { return $this->generateCode() ? self::SUCCESS : self::FAILURE; @@ -54,6 +55,7 @@ protected function getGeneratorSourcePath(): string * @param string $name * @return string */ + #[\Override] protected function getPath($name) { return $this->getPathUsingCanvas($name); @@ -64,6 +66,7 @@ protected function getPath($name) * * @return string */ + #[\Override] protected function rootNamespace() { return $this->generatorPreset()->seederNamespace(); diff --git a/src/Console/SessionTableCommand.php b/src/Console/SessionTableCommand.php index 9cbe0fa..9d0382d 100644 --- a/src/Console/SessionTableCommand.php +++ b/src/Console/SessionTableCommand.php @@ -34,6 +34,7 @@ public function __construct(Filesystem $files, Composer $composer) * * @return string */ + #[\Override] protected function createBaseMigration() { return $this->createBaseMigrationUsingCanvas('sessions'); diff --git a/src/Console/TestMakeCommand.php b/src/Console/TestMakeCommand.php index 2301cf7..44fec68 100644 --- a/src/Console/TestMakeCommand.php +++ b/src/Console/TestMakeCommand.php @@ -37,6 +37,7 @@ public function __construct(Filesystem $files) * * @throws \Illuminate\Contracts\Filesystem\FileNotFoundException */ + #[\Override] public function handle() { return $this->generateCode() ? self::SUCCESS : self::FAILURE; @@ -74,7 +75,7 @@ protected function replaceTestCase(string $stub, string $testCase): string { $namespaceTestCase = $testCase = str_replace('/', '\\', $testCase); - if (Str::startsWith($testCase, '\\')) { + if (str_starts_with($testCase, '\\')) { $stub = str_replace('NamespacedDummyTestCase', trim($testCase, '\\'), $stub); } else { $stub = str_replace('NamespacedDummyTestCase', $namespaceTestCase, $stub); @@ -95,6 +96,7 @@ protected function replaceTestCase(string $stub, string $testCase): string * @param string $stub * @return string */ + #[\Override] protected function resolveStubPath($stub) { $preset = $this->generatorPreset(); @@ -133,6 +135,7 @@ protected function getGeneratorSourcePath(): string * @param string $name * @return string */ + #[\Override] protected function getPath($name) { return $this->getPathUsingCanvas($name); @@ -143,6 +146,7 @@ protected function getPath($name) * * @return string */ + #[\Override] protected function rootNamespace() { return $this->generatorPreset()->testingNamespace(); diff --git a/src/Console/UserFactoryMakeCommand.php b/src/Console/UserFactoryMakeCommand.php index 1578524..7d56bb8 100644 --- a/src/Console/UserFactoryMakeCommand.php +++ b/src/Console/UserFactoryMakeCommand.php @@ -24,6 +24,7 @@ class UserFactoryMakeCommand extends GeneratorCommand * * @return string */ + #[\Override] protected function getStub() { return $this->resolveStubPath('/stubs/user-factory.stub'); @@ -45,6 +46,7 @@ protected function resolveDefaultStubPath($stub) * * @return string */ + #[\Override] protected function rootNamespace() { return $this->generatorPreset()->factoryNamespace(); @@ -81,6 +83,7 @@ public function generatingCode(string $stub, string $className): string * * @return string */ + #[\Override] protected function getNameInput() { return 'UserFactory'; @@ -91,6 +94,7 @@ protected function getNameInput() * * @return array */ + #[\Override] protected function getArguments() { return []; @@ -101,6 +105,7 @@ protected function getArguments() * * @return array */ + #[\Override] protected function getOptions() { return [ diff --git a/src/Console/UserModelMakeCommand.php b/src/Console/UserModelMakeCommand.php index 751bcb9..4d16b9d 100644 --- a/src/Console/UserModelMakeCommand.php +++ b/src/Console/UserModelMakeCommand.php @@ -36,7 +36,6 @@ protected function getStub() * @param string $stub * @return string */ - #[\Override] protected function resolveDefaultStubPath($stub) { return __DIR__.$stub; @@ -78,6 +77,7 @@ protected function getArguments() * * @return array */ + #[\Override] protected function getOptions() { return [