From 019789811152848237e3cad8951689a4a7dbf849 Mon Sep 17 00:00:00 2001 From: Ash Allen Date: Tue, 27 Aug 2024 09:19:29 +0100 Subject: [PATCH 1/5] Added docblocks for model factories. --- src/Models/ShortURL.php | 3 +++ src/Models/ShortURLVisit.php | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/Models/ShortURL.php b/src/Models/ShortURL.php index ac93000..d1d5cba 100644 --- a/src/Models/ShortURL.php +++ b/src/Models/ShortURL.php @@ -34,6 +34,9 @@ */ class ShortURL extends Model { + /** + * @extends Factory + */ use HasFactory; /** diff --git a/src/Models/ShortURLVisit.php b/src/Models/ShortURLVisit.php index b28fbdc..b178fad 100644 --- a/src/Models/ShortURLVisit.php +++ b/src/Models/ShortURLVisit.php @@ -26,6 +26,9 @@ */ class ShortURLVisit extends Model { + /** + * @extends Factory + */ use HasFactory; public const DEVICE_TYPE_MOBILE = 'mobile'; From 48c0ba94ced94411abc3312b1b8e0ebb0cb6b407 Mon Sep 17 00:00:00 2001 From: Ash Allen Date: Tue, 27 Aug 2024 09:22:32 +0100 Subject: [PATCH 2/5] Use correct tag. --- src/Models/ShortURL.php | 2 +- src/Models/ShortURLVisit.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Models/ShortURL.php b/src/Models/ShortURL.php index d1d5cba..04a3401 100644 --- a/src/Models/ShortURL.php +++ b/src/Models/ShortURL.php @@ -35,7 +35,7 @@ class ShortURL extends Model { /** - * @extends Factory + * @use Factory */ use HasFactory; diff --git a/src/Models/ShortURLVisit.php b/src/Models/ShortURLVisit.php index b178fad..9beedb1 100644 --- a/src/Models/ShortURLVisit.php +++ b/src/Models/ShortURLVisit.php @@ -27,7 +27,7 @@ class ShortURLVisit extends Model { /** - * @extends Factory + * @use Factory */ use HasFactory; From c3199eb3f5790c2db2a6cf1729413fddc2df8dff Mon Sep 17 00:00:00 2001 From: Ash Allen Date: Tue, 27 Aug 2024 09:25:23 +0100 Subject: [PATCH 3/5] Use correct tag. --- src/Models/ShortURL.php | 2 +- src/Models/ShortURLVisit.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Models/ShortURL.php b/src/Models/ShortURL.php index 04a3401..b8fc443 100644 --- a/src/Models/ShortURL.php +++ b/src/Models/ShortURL.php @@ -35,7 +35,7 @@ class ShortURL extends Model { /** - * @use Factory + * @use HasFactory */ use HasFactory; diff --git a/src/Models/ShortURLVisit.php b/src/Models/ShortURLVisit.php index 9beedb1..7ace516 100644 --- a/src/Models/ShortURLVisit.php +++ b/src/Models/ShortURLVisit.php @@ -27,7 +27,7 @@ class ShortURLVisit extends Model { /** - * @use Factory + * @use HasFactory */ use HasFactory; From 0183137583ffb077ecb8b2a01187e3e3d1074cd3 Mon Sep 17 00:00:00 2001 From: Ash Allen Date: Tue, 27 Aug 2024 09:28:37 +0100 Subject: [PATCH 4/5] Ignore PHPStan error on earlier Laravel versions. --- phpstan.neon | 2 ++ 1 file changed, 2 insertions(+) diff --git a/phpstan.neon b/phpstan.neon index 428e008..3665343 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -9,5 +9,7 @@ parameters: level: 6 ignoreErrors: + - '#PHPDoc tag \@use contains generic type Illuminate\\Database\\Eloquent\\Factories\\HasFactory\ but trait Illuminate\\Database\\Eloquent\\Factories\\HasFactory is not generic\.#' + - '#PHPDoc tag \@use contains generic type Illuminate\\Database\\Eloquent\\Factories\\HasFactory\ but trait Illuminate\\Database\\Eloquent\\Factories\\HasFactory is not generic\.#' checkMissingIterableValueType: false From aee14e4c76db1c23a9da2356d91bf6757524426d Mon Sep 17 00:00:00 2001 From: Ash Allen Date: Tue, 27 Aug 2024 09:30:34 +0100 Subject: [PATCH 5/5] Use correct class name. --- src/Models/ShortURL.php | 3 ++- src/Models/ShortURLVisit.php | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Models/ShortURL.php b/src/Models/ShortURL.php index b8fc443..3657f29 100644 --- a/src/Models/ShortURL.php +++ b/src/Models/ShortURL.php @@ -4,6 +4,7 @@ namespace AshAllenDesign\ShortURL\Models; +use AshAllenDesign\ShortURL\Models\Factories\ShortURLFactory; use Carbon\CarbonInterface; use Illuminate\Database\Eloquent\Collection; use Illuminate\Database\Eloquent\Factories\Factory; @@ -35,7 +36,7 @@ class ShortURL extends Model { /** - * @use HasFactory + * @use HasFactory */ use HasFactory; diff --git a/src/Models/ShortURLVisit.php b/src/Models/ShortURLVisit.php index 7ace516..90fa6fd 100644 --- a/src/Models/ShortURLVisit.php +++ b/src/Models/ShortURLVisit.php @@ -4,6 +4,7 @@ namespace AshAllenDesign\ShortURL\Models; +use AshAllenDesign\ShortURL\Models\Factories\ShortURLVisitFactory; use Carbon\CarbonInterface; use Illuminate\Database\Eloquent\Factories\Factory; use Illuminate\Database\Eloquent\Factories\HasFactory; @@ -27,7 +28,7 @@ class ShortURLVisit extends Model { /** - * @use HasFactory + * @use HasFactory */ use HasFactory;