Skip to content

Commit

Permalink
change some stubs
Browse files Browse the repository at this point in the history
  • Loading branch information
regnerisch committed Jul 31, 2024
1 parent 3935738 commit aef7ceb
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 10 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down
4 changes: 0 additions & 4 deletions stubs/cast.stub
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ use Illuminate\Database\Eloquent\Model;
final class {{ className }} implements CastsAttributes
{
/**
* Cast the given value.
*
* @param array<string, mixed> $attributes
*/
public function get(Model $model, string $key, mixed $value, array $attributes): mixed
Expand All @@ -18,8 +16,6 @@ final class {{ className }} implements CastsAttributes
}

/**
* Prepare the given value for storage.
*
* @param array<string, mixed> $attributes
*/
public function set(Model $model, string $key, mixed $value, array $attributes): mixed
Expand Down
2 changes: 1 addition & 1 deletion stubs/job.stub
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ final class {{ className }} implements ShouldQueue
//
}

public function handle()
public function handle(): void
{
//
}
Expand Down
2 changes: 1 addition & 1 deletion stubs/job.sync.stub
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ final class {{ className }}
//
}

public function handle()
public function handle(): void
{
//
}
Expand Down
2 changes: 1 addition & 1 deletion stubs/listener.stub
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ final class {{ className }}
//
}

public function handle($event)
public function handle($event): void
{
//
}
Expand Down
4 changes: 4 additions & 0 deletions stubs/request.stub
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,14 @@

namespace {{ namespace }};

use Illuminate\Contracts\Validation\ValidationRule;
use Illuminate\Foundation\Http\FormRequest;

final class {{ className }} extends FormRequest
{
/**
* @return array<string, ValidationRule|array<mixed>|string>
*/
public function rules(): array
{
return [
Expand Down
6 changes: 5 additions & 1 deletion stubs/resource.collection.stub
Original file line number Diff line number Diff line change
Expand Up @@ -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<string, mixed>
*/
public function toArray(Request $request): array
{
return parent::toArray($request);
}
Expand Down
6 changes: 5 additions & 1 deletion stubs/resource.stub
Original file line number Diff line number Diff line change
Expand Up @@ -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<string, mixed>
*/
public function toArray(Request $request): array
{
return parent::toArray($request);
}
Expand Down

0 comments on commit aef7ceb

Please sign in to comment.