From aef7ceb68cdd7b5278e9a1401ac17d5444825eb4 Mon Sep 17 00:00:00 2001 From: Jonas Regner Date: Wed, 31 Jul 2024 10:37:38 +0200 Subject: [PATCH] change some stubs --- CHANGELOG.md | 7 ++++++- stubs/cast.stub | 4 ---- stubs/job.stub | 2 +- stubs/job.sync.stub | 2 +- stubs/listener.stub | 2 +- stubs/request.stub | 4 ++++ stubs/resource.collection.stub | 6 +++++- stubs/resource.stub | 6 +++++- 8 files changed, 23 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8961afb..d58e2ec 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [7.0.2] +### Changed +- Stubs by [@regnerisch](https://github.com/regnerisch) + ## [7.0.1] ### Changed - Changelog by [@regnerisch](https://github.com/regnerisch) @@ -174,7 +178,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Removed - Remove auto generation of changelog in release it by [@regnerisch](https://github.com/regnerisch) -[Unreleased]: https://github.com/regnerisch/laravel-beyond/compare/v7.0.1...HEAD +[Unreleased]: https://github.com/regnerisch/laravel-beyond/compare/v7.0.2...HEAD +[7.0.1]: https://github.com/regnerisch/laravel-beyond/compare/v7.0.1...v7.0.2 [7.0.1]: https://github.com/regnerisch/laravel-beyond/compare/v7.0.0...v7.0.1 [7.0.0]: https://github.com/regnerisch/laravel-beyond/compare/v7.0.0-beta.7...v7.0.0 [7.0.0-beta.7]: https://github.com/regnerisch/laravel-beyond/compare/v7.0.0-beta.6...v7.0.0-beta.7 diff --git a/stubs/cast.stub b/stubs/cast.stub index 32c3f32..e1cc2a3 100644 --- a/stubs/cast.stub +++ b/stubs/cast.stub @@ -8,8 +8,6 @@ use Illuminate\Database\Eloquent\Model; final class {{ className }} implements CastsAttributes { /** - * Cast the given value. - * * @param array $attributes */ public function get(Model $model, string $key, mixed $value, array $attributes): mixed @@ -18,8 +16,6 @@ final class {{ className }} implements CastsAttributes } /** - * Prepare the given value for storage. - * * @param array $attributes */ public function set(Model $model, string $key, mixed $value, array $attributes): mixed diff --git a/stubs/job.stub b/stubs/job.stub index 6b6753a..2ecd3e7 100644 --- a/stubs/job.stub +++ b/stubs/job.stub @@ -18,7 +18,7 @@ final class {{ className }} implements ShouldQueue // } - public function handle() + public function handle(): void { // } diff --git a/stubs/job.sync.stub b/stubs/job.sync.stub index 61b4b96..0e2172e 100644 --- a/stubs/job.sync.stub +++ b/stubs/job.sync.stub @@ -13,7 +13,7 @@ final class {{ className }} // } - public function handle() + public function handle(): void { // } diff --git a/stubs/listener.stub b/stubs/listener.stub index 29d4df0..64fa327 100644 --- a/stubs/listener.stub +++ b/stubs/listener.stub @@ -12,7 +12,7 @@ final class {{ className }} // } - public function handle($event) + public function handle($event): void { // } diff --git a/stubs/request.stub b/stubs/request.stub index 764e779..24c25e1 100644 --- a/stubs/request.stub +++ b/stubs/request.stub @@ -2,10 +2,14 @@ namespace {{ namespace }}; +use Illuminate\Contracts\Validation\ValidationRule; use Illuminate\Foundation\Http\FormRequest; final class {{ className }} extends FormRequest { + /** + * @return array|string> + */ public function rules(): array { return [ diff --git a/stubs/resource.collection.stub b/stubs/resource.collection.stub index 3fc621e..8028294 100644 --- a/stubs/resource.collection.stub +++ b/stubs/resource.collection.stub @@ -2,11 +2,15 @@ namespace {{ namespace }}; +use Illuminate\Http\Request; use Illuminate\Http\Resources\Json\ResourceCollection; final class {{ className }} extends ResourceCollection { - public function toArray($request): array + /** + * @return array + */ + public function toArray(Request $request): array { return parent::toArray($request); } diff --git a/stubs/resource.stub b/stubs/resource.stub index a33b348..7eaf401 100644 --- a/stubs/resource.stub +++ b/stubs/resource.stub @@ -2,11 +2,15 @@ namespace {{ namespace }}; +use Illuminate\Http\Request; use Illuminate\Http\Resources\Json\JsonResource; final class {{ className }} extends JsonResource { - public function toArray($request): array + /** + * @return array + */ + public function toArray(Request $request): array { return parent::toArray($request); }