Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[7.] Add #[\Override] #40

Merged
merged 4 commits into from
Nov 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion phpstan.neon.dist
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ parameters:
level: 7

ignoreErrors:
# - identifier: missingType.generics
- identifier: missingType.iterableValue
- '#Method [a-zA-Z\\\<\>]+::handle\(\) should return bool\|null but returns int.#'

checkGenericClassInNonGenericObjectType: false
treatPhpDocTypesAsCertain: false
1 change: 1 addition & 0 deletions src/Console/BatchesTableCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public function __construct(Filesystem $files, Composer $composer)
* @param string $table
* @return string
*/
#[\Override]
protected function createBaseMigration($table = 'job_batches')
{
return $this->createBaseMigrationUsingCanvas($table);
Expand Down
3 changes: 3 additions & 0 deletions src/Console/CastMakeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -46,6 +47,7 @@ public function handle()
* @param string $name
* @return string
*/
#[\Override]
protected function getPath($name)
{
return $this->getPathUsingCanvas($name);
Expand All @@ -56,6 +58,7 @@ protected function getPath($name)
*
* @return string
*/
#[\Override]
protected function rootNamespace()
{
return $this->rootNamespaceUsingCanvas();
Expand Down
3 changes: 3 additions & 0 deletions src/Console/ChannelMakeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -48,6 +49,7 @@ public function handle()
* @param string $name
* @return string
*/
#[\Override]
protected function getPath($name)
{
return $this->getPathUsingCanvas($name);
Expand All @@ -58,6 +60,7 @@ protected function getPath($name)
*
* @return string
*/
#[\Override]
protected function rootNamespace()
{
return $this->rootNamespaceUsingCanvas();
Expand Down
2 changes: 2 additions & 0 deletions src/Console/CodeMakeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ class CodeMakeCommand extends GeneratorCommand
*
* @return string
*/
#[\Override]
protected function getStub()
{
return $this->resolveStubPath('/stubs/class.stub');
Expand All @@ -43,6 +44,7 @@ protected function resolveDefaultStubPath($stub)
*
* @return array<int, array>
*/
#[\Override]
protected function getOptions()
{
return [
Expand Down
1 change: 1 addition & 0 deletions src/Console/Commander.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ protected function resolveApplicationCallback()
*
* @return \Illuminate\Foundation\Application
*/
#[\Override]
public function laravel()
{
if (! $this->app instanceof LaravelApplication) {
Expand Down
4 changes: 4 additions & 0 deletions src/Console/ComponentMakeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
Expand All @@ -68,6 +70,7 @@ protected function getPath($name)
*
* @return string
*/
#[\Override]
protected function rootNamespace()
{
return $this->rootNamespaceUsingCanvas();
Expand All @@ -79,6 +82,7 @@ protected function rootNamespace()
* @param string $path
* @return string
*/
#[\Override]
protected function viewPath($path = '')
{
return $this->viewPathUsingCanvas($path);
Expand Down
4 changes: 4 additions & 0 deletions src/Console/ConsoleMakeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -48,6 +49,7 @@ public function handle()
* @param string $name
* @return string
*/
#[\Override]
protected function getPath($name)
{
return $this->getPathUsingCanvas($name);
Expand All @@ -58,6 +60,7 @@ protected function getPath($name)
*
* @return string
*/
#[\Override]
protected function rootNamespace()
{
return $this->rootNamespaceUsingCanvas();
Expand All @@ -69,6 +72,7 @@ protected function rootNamespace()
* @param string $rootNamespace
* @return string
*/
#[\Override]
protected function getDefaultNamespace($rootNamespace)
{
return rtrim($this->generatorPreset()->commandNamespace(), '\\');
Expand Down
6 changes: 6 additions & 0 deletions src/Console/ControllerMakeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -48,6 +49,7 @@ public function handle()
* @param string $model
* @return string
*/
#[\Override]
protected function qualifyModel(string $model)
{
return $this->qualifyModelUsingCanvas($model);
Expand All @@ -58,6 +60,7 @@ protected function qualifyModel(string $model)
*
* @return array
*/
#[\Override]
protected function buildParentReplacements()
{
$parentModelClass = $this->parseModel($this->option('parent'));
Expand Down Expand Up @@ -86,6 +89,7 @@ protected function buildParentReplacements()
* @param array $replace
* @return array
*/
#[\Override]
protected function buildModelReplacements(array $replace)
{
$modelClass = $this->parseModel($this->option('model'));
Expand Down Expand Up @@ -115,6 +119,7 @@ protected function buildModelReplacements(array $replace)
* @param string $name
* @return string
*/
#[\Override]
protected function getPath($name)
{
return $this->getPathUsingCanvas($name);
Expand All @@ -125,6 +130,7 @@ protected function getPath($name)
*
* @return string
*/
#[\Override]
protected function rootNamespace()
{
return $this->rootNamespaceUsingCanvas();
Expand Down
3 changes: 3 additions & 0 deletions src/Console/EventMakeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -46,6 +47,7 @@ public function handle()
* @param string $name
* @return string
*/
#[\Override]
protected function getPath($name)
{
return $this->getPathUsingCanvas($name);
Expand All @@ -56,6 +58,7 @@ protected function getPath($name)
*
* @return string
*/
#[\Override]
protected function rootNamespace()
{
return $this->rootNamespaceUsingCanvas();
Expand Down
3 changes: 3 additions & 0 deletions src/Console/ExceptionMakeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -46,6 +47,7 @@ public function handle()
* @param string $name
* @return string
*/
#[\Override]
protected function getPath($name)
{
return $this->getPathUsingCanvas($name);
Expand All @@ -56,6 +58,7 @@ protected function getPath($name)
*
* @return string
*/
#[\Override]
protected function rootNamespace()
{
return $this->rootNamespaceUsingCanvas();
Expand Down
6 changes: 6 additions & 0 deletions src/Console/FactoryMakeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -59,6 +60,7 @@ protected function resolveDefaultStubPath($stub)
* @param string $name
* @return string
*/
#[\Override]
protected function getNamespace($name)
{
return rtrim($this->generatorPreset()->factoryNamespace(), '\\');
Expand All @@ -78,6 +80,7 @@ protected function getGeneratorSourcePath(): string
* @param string $name
* @return string
*/
#[\Override]
protected function guessModelName($name)
{
if (str_ends_with($name, 'Factory')) {
Expand All @@ -93,6 +96,7 @@ protected function guessModelName($name)
* @param string $name
* @return string
*/
#[\Override]
protected function getPath($name)
{
return $this->getPathUsingCanvas($name);
Expand All @@ -103,6 +107,7 @@ protected function getPath($name)
*
* @return string
*/
#[\Override]
protected function rootNamespace()
{
return $this->rootNamespaceUsingCanvas();
Expand All @@ -113,6 +118,7 @@ protected function rootNamespace()
*
* @return string|null
*/
#[\Override]
protected function userProviderModel()
{
return $this->userProviderModelUsingCanvas();
Expand Down
1 change: 1 addition & 0 deletions src/Console/FailedTableCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 4 additions & 0 deletions src/Console/GeneratorMakeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ class GeneratorMakeCommand extends GeneratorCommand
* @param string $name
* @return string
*/
#[\Override]
protected function replaceClass($stub, $name)
{
$stub = parent::replaceClass($stub, $name);
Expand All @@ -42,6 +43,7 @@ protected function replaceClass($stub, $name)
*
* @return string
*/
#[\Override]
protected function getStub()
{
return $this->resolveStubPath('/stubs/generator.stub');
Expand All @@ -64,6 +66,7 @@ protected function resolveDefaultStubPath($stub)
* @param string $rootNamespace
* @return string
*/
#[\Override]
protected function getDefaultNamespace($rootNamespace)
{
return rtrim($this->generatorPreset()->commandNamespace(), '\\');
Expand All @@ -74,6 +77,7 @@ protected function getDefaultNamespace($rootNamespace)
*
* @return array<int, array>
*/
#[\Override]
protected function getOptions()
{
return [
Expand Down
3 changes: 3 additions & 0 deletions src/Console/JobMakeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -48,6 +49,7 @@ public function handle()
* @param string $name
* @return string
*/
#[\Override]
protected function getPath($name)
{
return $this->getPathUsingCanvas($name);
Expand All @@ -58,6 +60,7 @@ protected function getPath($name)
*
* @return string
*/
#[\Override]
protected function rootNamespace()
{
return $this->rootNamespaceUsingCanvas();
Expand Down
3 changes: 3 additions & 0 deletions src/Console/ListenerMakeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -48,6 +49,7 @@ public function handle()
* @param string $name
* @return string
*/
#[\Override]
protected function getPath($name)
{
return $this->getPathUsingCanvas($name);
Expand All @@ -58,6 +60,7 @@ protected function getPath($name)
*
* @return string
*/
#[\Override]
protected function rootNamespace()
{
return $this->rootNamespaceUsingCanvas();
Expand Down
Loading
Loading