Skip to content

Commit 9f8d842

Browse files
Merge pull request #48 from simon-tma/patch-1
Use a return type of `static`
2 parents d497907 + e31292a commit 9f8d842

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/Concerns/DataResolver.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ trait DataResolver
1717
/**
1818
* @throws InvalidJsonException|ValidationException|MissingCastTypeException|CastTargetException
1919
*/
20-
public static function fromJson(string $json): self
20+
public static function fromJson(string $json): static
2121
{
2222
$jsonDecoded = json_decode($json, true);
2323
if (! is_array($jsonDecoded)) {
@@ -30,47 +30,47 @@ public static function fromJson(string $json): self
3030
/**
3131
* @throws CastTargetException|MissingCastTypeException
3232
*/
33-
public static function fromArray(array $array): self
33+
public static function fromArray(array $array): static
3434
{
3535
return new static($array);
3636
}
3737

3838
/**
3939
* @throws ValidationException|MissingCastTypeException|CastTargetException
4040
*/
41-
public static function fromRequest(Request $request): self
41+
public static function fromRequest(Request $request): static
4242
{
4343
return new static($request->all());
4444
}
4545

4646
/**
4747
* @throws ValidationException|MissingCastTypeException|CastTargetException
4848
*/
49-
public static function fromModel(Model $model): self
49+
public static function fromModel(Model $model): static
5050
{
5151
return new static($model->toArray());
5252
}
5353

5454
/**
5555
* @throws ValidationException|MissingCastTypeException|CastTargetException
5656
*/
57-
public static function fromCommandArguments(Command $command): self
57+
public static function fromCommandArguments(Command $command): static
5858
{
5959
return new static($command->arguments());
6060
}
6161

6262
/**
6363
* @throws ValidationException|MissingCastTypeException|CastTargetException
6464
*/
65-
public static function fromCommandOptions(Command $command): self
65+
public static function fromCommandOptions(Command $command): static
6666
{
6767
return new static($command->options());
6868
}
6969

7070
/**
7171
* @throws ValidationException|MissingCastTypeException|CastTargetException
7272
*/
73-
public static function fromCommand(Command $command): self
73+
public static function fromCommand(Command $command): static
7474
{
7575
return new static(array_merge($command->arguments(), $command->options()));
7676
}

0 commit comments

Comments
 (0)