Skip to content

Commit df42a83

Browse files
committed
Apply fixes from StyleCI
1 parent 83ca872 commit df42a83

File tree

7 files changed

+12
-12
lines changed

7 files changed

+12
-12
lines changed

src/Concerns/Resource/ConfiguresRestParameters.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public function getFields(\Lomkit\Rest\Http\Requests\RestRequest $request): arra
4747
*
4848
* @return bool
4949
*/
50-
public function isNestedField(string $field, Relation $relation = null)
50+
public function isNestedField(string $field, ?Relation $relation = null)
5151
{
5252
if (Str::contains($field, '.')) {
5353
// In case we are on a pivot we look for the relation pivot fields

src/Contracts/RelationResource.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@
77

88
interface RelationResource
99
{
10-
public function filter(Builder $query, $relation, $operator, $value, $boolean = 'and', Closure $callback = null);
10+
public function filter(Builder $query, $relation, $operator, $value, $boolean = 'and', ?Closure $callback = null);
1111
}

src/Documentation/Schemas/Info.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class Info extends Schema
3030
*
3131
* @var string|null
3232
*/
33-
protected string|null $termsOfService;
33+
protected ?string $termsOfService;
3434

3535
/**
3636
* The contact information for the exposed API.
@@ -132,7 +132,7 @@ public function description(): string
132132
*
133133
* @return Info
134134
*/
135-
public function withTermsOfService(string|null $termsOfService): Info
135+
public function withTermsOfService(?string $termsOfService): Info
136136
{
137137
$this->termsOfService = $termsOfService;
138138

@@ -144,7 +144,7 @@ public function withTermsOfService(string|null $termsOfService): Info
144144
*
145145
* @return string|null
146146
*/
147-
public function termsOfService(): string|null
147+
public function termsOfService(): ?string
148148
{
149149
return $this->termsOfService;
150150
}

src/Documentation/Schemas/License.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class License extends Schema
2323
*
2424
* @var string
2525
*/
26-
protected string|null $url;
26+
protected ?string $url;
2727

2828
/**
2929
* Set the name of the license used for the API.
@@ -80,7 +80,7 @@ public function identifier(): string
8080
*
8181
* @return License
8282
*/
83-
public function withUrl(string|null $url): License
83+
public function withUrl(?string $url): License
8484
{
8585
$this->url = $url;
8686

@@ -92,7 +92,7 @@ public function withUrl(string|null $url): License
9292
*
9393
* @return string|null
9494
*/
95-
public function url(): string|null
95+
public function url(): ?string
9696
{
9797
return $this->url;
9898
}

src/Query/Builder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class Builder implements QueryBuilder
2424
*
2525
* @return void
2626
*/
27-
public function __construct(Resource $resource, \Illuminate\Database\Eloquent\Builder|Relation $query = null)
27+
public function __construct(Resource $resource, \Illuminate\Database\Eloquent\Builder|Relation|null $query = null)
2828
{
2929
$this->resource = $resource;
3030
$this->queryBuilder = $query ?? $resource::newModel()->query();

src/Relations/Relation.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public function name()
5757
*
5858
* @return Builder
5959
*/
60-
public function filter(Builder $query, $relation, $operator, $value, $boolean = 'and', Closure $callback = null)
60+
public function filter(Builder $query, $relation, $operator, $value, $boolean = 'and', ?Closure $callback = null)
6161
{
6262
return $query->has(Str::beforeLast(relation_without_pivot($relation), '.'), '>=', 1, $boolean, function (Builder $query) use ($value, $operator, $relation, $callback) {
6363
$field = (Str::contains($relation, '.pivot.') ?

src/Rules/MutateRules.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class MutateRules implements ValidationRule, ValidatorAwareRule
4040
*
4141
* @var Relation|null
4242
*/
43-
protected Relation|null $relation;
43+
protected ?Relation $relation;
4444

4545
/**
4646
* Specify if the validation is at root level.
@@ -49,7 +49,7 @@ class MutateRules implements ValidationRule, ValidatorAwareRule
4949
*/
5050
protected bool $isRootValidation;
5151

52-
public function __construct(\Lomkit\Rest\Http\Resource $resource, RestRequest $request, Relation $relation = null, bool $isRootValidation = false)
52+
public function __construct(\Lomkit\Rest\Http\Resource $resource, RestRequest $request, ?Relation $relation = null, bool $isRootValidation = false)
5353
{
5454
$this->resource = $resource;
5555
$this->request = $request;

0 commit comments

Comments
 (0)