From 8b39b97353c816009686fb3f515daf070f805d5a Mon Sep 17 00:00:00 2001 From: Jason McCreary Date: Wed, 6 Dec 2023 13:23:40 -0500 Subject: [PATCH] Lint --- src/Generators/ModelGenerator.php | 4 ++-- src/Lexers/ConfigLexer.php | 2 +- src/Models/Controller.php | 2 +- src/Models/Statements/SendStatement.php | 2 +- src/Tracer.php | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Generators/ModelGenerator.php b/src/Generators/ModelGenerator.php index 5d75ecc8..1f7cabef 100644 --- a/src/Generators/ModelGenerator.php +++ b/src/Generators/ModelGenerator.php @@ -272,12 +272,12 @@ protected function buildRelationships(Model $model): string protected function addTraits(Model $model, $stub): string { $traits = ['HasFactory']; - + if ($model->usesSoftDeletes()) { $this->addImport($model, 'Illuminate\\Database\\Eloquent\\SoftDeletes'); $traits[] = 'SoftDeletes'; } - + if ($model->usesUuids()) { $this->addImport($model, 'Illuminate\\Database\\Eloquent\\Concerns\\HasUuids'); $traits[] = 'HasUuids'; diff --git a/src/Lexers/ConfigLexer.php b/src/Lexers/ConfigLexer.php index 1e5ec731..d9b98700 100644 --- a/src/Lexers/ConfigLexer.php +++ b/src/Lexers/ConfigLexer.php @@ -9,7 +9,7 @@ class ConfigLexer implements Lexer { private Container $app; - public function __construct(Container $app = null) + public function __construct(?Container $app = null) { $this->app = $app ?? Container::getInstance(); } diff --git a/src/Models/Controller.php b/src/Models/Controller.php index 67bda5a3..a1aa2e4d 100644 --- a/src/Models/Controller.php +++ b/src/Models/Controller.php @@ -79,7 +79,7 @@ public function addMethod(string $name, array $statements): void $this->methods[$name] = $statements; } - public function policy(Policy $policy = null): ?Policy + public function policy(?Policy $policy = null): ?Policy { if ($policy) { $this->policy = $policy; diff --git a/src/Models/Statements/SendStatement.php b/src/Models/Statements/SendStatement.php index bf11bc9a..89e114d7 100644 --- a/src/Models/Statements/SendStatement.php +++ b/src/Models/Statements/SendStatement.php @@ -24,7 +24,7 @@ class SendStatement private string $subject; - public function __construct(string $mail, ?string $to, array $data, string $type, string $view = null) + public function __construct(string $mail, ?string $to, array $data, string $type, ?string $view = null) { $this->mail = $mail; $this->data = $data; diff --git a/src/Tracer.php b/src/Tracer.php index 4c99be52..49207190 100644 --- a/src/Tracer.php +++ b/src/Tracer.php @@ -10,7 +10,7 @@ class Tracer { private Filesystem $filesystem; - public function execute(Blueprint $blueprint, Filesystem $filesystem, array $paths = null): array + public function execute(Blueprint $blueprint, Filesystem $filesystem, ?array $paths = null): array { $this->filesystem = $filesystem;