Skip to content

Commit fd7ebf8

Browse files
committed
Merge branch 'release/4.4.0'
2 parents 98899c6 + 73426be commit fd7ebf8

37 files changed

+63
-52
lines changed

.github/workflows/tests.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ jobs:
1414
strategy:
1515
fail-fast: true
1616
matrix:
17-
php: [8.2, 8.3]
18-
laravel: [11]
17+
php: [8.2, 8.3, 8.4]
18+
core: ['4.3.2', '5.0.1']
1919

2020
steps:
2121
- name: Checkout Code
@@ -30,8 +30,8 @@ jobs:
3030
coverage: none
3131
ini-values: error_reporting=E_ALL
3232

33-
- name: Set Laravel Version
34-
run: composer require "illuminate/database:^${{ matrix.laravel }}" --no-update
33+
- name: Set Laravel JSON:API Core Version
34+
run: composer require "laravel-json-api/core:^${{ matrix.core }}" --no-update
3535

3636
- name: Install dependencies
3737
uses: nick-fields/retry@v3

CHANGELOG.md

+10
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,16 @@ All notable changes to this project will be documented in this file. This projec
55

66
## Unreleased
77

8+
## [4.4.0] - 2024-11-30
9+
10+
### Added
11+
12+
- Allow `laravel-json-api/core` v4 and v5.
13+
14+
### Fixed
15+
16+
- Remove deprecation notices in PHP 8.4.
17+
818
## [4.3.1] - 2024-10-31
919

1020
### Fixed

composer.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"ext-json": "*",
2828
"illuminate/database": "^11.0",
2929
"illuminate/support": "^11.0",
30-
"laravel-json-api/core": "^4.0"
30+
"laravel-json-api/core": "^4.3.2|^5.0.1"
3131
},
3232
"require-dev": {
3333
"orchestra/testbench": "^9.0",
@@ -50,7 +50,7 @@
5050
"dev-develop": "4.x-dev"
5151
}
5252
},
53-
"minimum-stability": "dev",
53+
"minimum-stability": "stable",
5454
"prefer-stable": true,
5555
"config": {
5656
"sort-packages": true

phpunit.xml

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
failOnWarning="true"
1414
failOnDeprecation="true"
1515
failOnNotice="true"
16+
displayDetailsOnTestsThatTriggerDeprecations="true"
1617
>
1718
<coverage/>
1819
<testsuites>

src/Fields/ArrayHash.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class ArrayHash extends Attribute
5555
* @param string|null $column
5656
* @return ArrayHash
5757
*/
58-
public static function make(string $fieldName, string $column = null): self
58+
public static function make(string $fieldName, ?string $column = null): self
5959
{
6060
return new self($fieldName, $column);
6161
}

src/Fields/ArrayList.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class ArrayList extends Attribute
3030
* @param string|null $column
3131
* @return ArrayList
3232
*/
33-
public static function make(string $fieldName, string $column = null): self
33+
public static function make(string $fieldName, ?string $column = null): self
3434
{
3535
return new self($fieldName, $column);
3636
}

src/Fields/Attribute.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ abstract protected function assertValue($value): void;
9191
* @param string $fieldName
9292
* @param string|null $column
9393
*/
94-
public function __construct(string $fieldName, string $column = null)
94+
public function __construct(string $fieldName, ?string $column = null)
9595
{
9696
if (empty($fieldName)) {
9797
throw new InvalidArgumentException('Expecting a non-empty string field name.');

src/Fields/Boolean.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class Boolean extends Attribute
2121
* @param string|null $column
2222
* @return Boolean
2323
*/
24-
public static function make(string $fieldName, string $column = null): self
24+
public static function make(string $fieldName, ?string $column = null): self
2525
{
2626
return new self($fieldName, $column);
2727
}

src/Fields/DateTime.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class DateTime extends Attribute
3737
* @param string|null $column
3838
* @return static
3939
*/
40-
public static function make(string $fieldName, string $column = null): self
40+
public static function make(string $fieldName, ?string $column = null): self
4141
{
4242
return new static($fieldName, $column);
4343
}

src/Fields/ID.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class ID implements IDContract, Fillable
3636
* @param string|null $column
3737
* @return static
3838
*/
39-
public static function make(string $column = null): self
39+
public static function make(?string $column = null): self
4040
{
4141
return new static($column);
4242
}
@@ -46,7 +46,7 @@ public static function make(string $column = null): self
4646
*
4747
* @param string|null $column
4848
*/
49-
public function __construct(string $column = null)
49+
public function __construct(?string $column = null)
5050
{
5151
$this->column = $column ?: null;
5252
$this->sortable();

src/Fields/Number.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class Number extends Attribute
2727
* @param string|null $column
2828
* @return Number
2929
*/
30-
public static function make(string $fieldName, string $column = null): self
30+
public static function make(string $fieldName, ?string $column = null): self
3131
{
3232
return new self($fieldName, $column);
3333
}

src/Fields/Relations/BelongsTo.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class BelongsTo extends ToOne implements FillableToOne
2626
* @param string|null $relation
2727
* @return static
2828
*/
29-
public static function make(string $fieldName, string $relation = null): BelongsTo
29+
public static function make(string $fieldName, ?string $relation = null): BelongsTo
3030
{
3131
return new static($fieldName, $relation);
3232
}
@@ -37,7 +37,7 @@ public static function make(string $fieldName, string $relation = null): Belongs
3737
* @param string $fieldName
3838
* @param string|null $relation
3939
*/
40-
public function __construct(string $fieldName, string $relation = null)
40+
public function __construct(string $fieldName, ?string $relation = null)
4141
{
4242
parent::__construct($fieldName, $relation);
4343
$this->mustValidate();

src/Fields/Relations/BelongsToMany.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class BelongsToMany extends ToMany implements FillableToMany
3131
* @param string|null $relation
3232
* @return BelongsToMany
3333
*/
34-
public static function make(string $fieldName, string $relation = null): BelongsToMany
34+
public static function make(string $fieldName, ?string $relation = null): BelongsToMany
3535
{
3636
return new self($fieldName, $relation);
3737
}

src/Fields/Relations/HasMany.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class HasMany extends ToMany implements FillableToMany
4646
* @param string|null $relation
4747
* @return HasMany
4848
*/
49-
public static function make(string $fieldName, string $relation = null): HasMany
49+
public static function make(string $fieldName, ?string $relation = null): HasMany
5050
{
5151
return new self($fieldName, $relation);
5252
}

src/Fields/Relations/HasManyThrough.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class HasManyThrough extends ToMany
2121
* @param string|null $relation
2222
* @return HasManyThrough
2323
*/
24-
public static function make(string $fieldName, string $relation = null): HasManyThrough
24+
public static function make(string $fieldName, ?string $relation = null): HasManyThrough
2525
{
2626
return new self($fieldName, $relation);
2727
}

src/Fields/Relations/HasOne.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class HasOne extends ToOne implements FillableToOne
4444
* @param string|null $relation
4545
* @return HasOne
4646
*/
47-
public static function make(string $fieldName, string $relation = null): HasOne
47+
public static function make(string $fieldName, ?string $relation = null): HasOne
4848
{
4949
return new self($fieldName, $relation);
5050
}

src/Fields/Relations/HasOneThrough.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class HasOneThrough extends ToOne
2121
* @param string|null $relation
2222
* @return HasOneThrough
2323
*/
24-
public static function make(string $fieldName, string $relation = null): HasOneThrough
24+
public static function make(string $fieldName, ?string $relation = null): HasOneThrough
2525
{
2626
return new self($fieldName, $relation);
2727
}

src/Fields/Relations/Relation.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ abstract protected function guessInverse(): string;
8989
* @param string $fieldName
9090
* @param string|null $relation
9191
*/
92-
public function __construct(string $fieldName, string $relation = null)
92+
public function __construct(string $fieldName, ?string $relation = null)
9393
{
9494
$this->name = $fieldName;
9595
$this->relation = $relation;

src/Fields/SoftDelete.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class SoftDelete extends DateTime
3232
* @param string $fieldName
3333
* @param string|null $column
3434
*/
35-
public function __construct(string $fieldName, string $column = null)
35+
public function __construct(string $fieldName, ?string $column = null)
3636
{
3737
parent::__construct($fieldName, $column);
3838
$this->unguarded();

src/Fields/Str.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class Str extends Attribute
2121
* @param string|null $column
2222
* @return Str
2323
*/
24-
public static function make(string $fieldName, string $column = null): self
24+
public static function make(string $fieldName, ?string $column = null): self
2525
{
2626
return new self($fieldName, $column);
2727
}

src/Filters/Has.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class Has implements Filter
3030
* @param string|null $key
3131
* @return static
3232
*/
33-
public static function make(Schema $schema, string $fieldName, string $key = null)
33+
public static function make(Schema $schema, string $fieldName, ?string $key = null)
3434
{
3535
return new static($schema, $fieldName, $key);
3636
}
@@ -42,7 +42,7 @@ public static function make(Schema $schema, string $fieldName, string $key = nul
4242
* @param string $fieldName
4343
* @param string|null $key
4444
*/
45-
public function __construct(Schema $schema, string $fieldName, string $key = null)
45+
public function __construct(Schema $schema, string $fieldName, ?string $key = null)
4646
{
4747
$this->schema = $schema;
4848
$this->fieldName = $fieldName;

src/Filters/Scope.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class Scope implements Filter
3737
* @param string|null $scope
3838
* @return static
3939
*/
40-
public static function make(string $name, string $scope = null)
40+
public static function make(string $name, ?string $scope = null)
4141
{
4242
return new static($name, $scope);
4343
}
@@ -48,7 +48,7 @@ public static function make(string $name, string $scope = null)
4848
* @param string $name
4949
* @param string|null $scope
5050
*/
51-
public function __construct(string $name, string $scope = null)
51+
public function __construct(string $name, ?string $scope = null)
5252
{
5353
$this->name = $name;
5454
$this->scope = $scope ?: $this->guessScope();

src/Filters/Where.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class Where implements Filter
3434
* @param string|null $column
3535
* @return static
3636
*/
37-
public static function make(string $name, string $column = null): self
37+
public static function make(string $name, ?string $column = null): self
3838
{
3939
return new static($name, $column);
4040
}
@@ -45,7 +45,7 @@ public static function make(string $name, string $column = null): self
4545
* @param string $name
4646
* @param string|null $column
4747
*/
48-
public function __construct(string $name, string $column = null)
48+
public function __construct(string $name, ?string $column = null)
4949
{
5050
$this->name = $name;
5151
$this->column = $column ?: $this->guessColumn();

src/Filters/WhereAll.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class WhereAll implements Filter
3434
* @param array<string>|null $columns
3535
* @return static
3636
*/
37-
public static function make(string $name, array $columns = null): static
37+
public static function make(string $name, ?array $columns = null): static
3838
{
3939
return new static($name, $columns);
4040
}
@@ -45,7 +45,7 @@ public static function make(string $name, array $columns = null): static
4545
* @param string $name
4646
* @param array<string>|null $columns
4747
*/
48-
public function __construct(string $name, array $columns = null)
48+
public function __construct(string $name, ?array $columns = null)
4949
{
5050
$this->name = $name;
5151
$this->columns = $columns ?? [];

src/Filters/WhereAny.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class WhereAny implements Filter
3434
* @param array<string>|null $columns
3535
* @return static
3636
*/
37-
public static function make(string $name, array $columns = null): static
37+
public static function make(string $name, ?array $columns = null): static
3838
{
3939
return new static($name, $columns);
4040
}
@@ -45,7 +45,7 @@ public static function make(string $name, array $columns = null): static
4545
* @param string $name
4646
* @param array<string>|null $columns
4747
*/
48-
public function __construct(string $name, array $columns = null)
48+
public function __construct(string $name, ?array $columns = null)
4949
{
5050
$this->name = $name;
5151
$this->columns = $columns ?? [];

src/Filters/WhereHas.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class WhereHas implements Filter
3333
* @param string|null $key
3434
* @return static
3535
*/
36-
public static function make(Schema $schema, string $fieldName, string $key = null)
36+
public static function make(Schema $schema, string $fieldName, ?string $key = null)
3737
{
3838
return new static($schema, $fieldName, $key);
3939
}
@@ -45,7 +45,7 @@ public static function make(Schema $schema, string $fieldName, string $key = nul
4545
* @param string $fieldName
4646
* @param string|null $key
4747
*/
48-
public function __construct(Schema $schema, string $fieldName, string $key = null)
48+
public function __construct(Schema $schema, string $fieldName, ?string $key = null)
4949
{
5050
$this->schema = $schema;
5151
$this->fieldName = $fieldName;

src/Filters/WhereIdIn.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class WhereIdIn implements Filter
4545
* @param string|null $key
4646
* @return static
4747
*/
48-
public static function make(Schema $schema, string $key = null): self
48+
public static function make(Schema $schema, ?string $key = null): self
4949
{
5050
if ($schema instanceof EloquentSchema) {
5151
return new static(

src/Filters/WhereIn.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class WhereIn implements Filter
3333
* @param string|null $column
3434
* @return static
3535
*/
36-
public static function make(string $name, string $column = null): self
36+
public static function make(string $name, ?string $column = null): self
3737
{
3838
return new static($name, $column);
3939
}
@@ -44,7 +44,7 @@ public static function make(string $name, string $column = null): self
4444
* @param string $name
4545
* @param string|null $column
4646
*/
47-
public function __construct(string $name, string $column = null)
47+
public function __construct(string $name, ?string $column = null)
4848
{
4949
$this->name = $name;
5050
$this->column = $column ?: $this->guessColumn();

src/Filters/WhereNull.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class WhereNull implements Filter
3232
*
3333
* @return static
3434
*/
35-
public static function make(string $name, string $column = null): self
35+
public static function make(string $name, ?string $column = null): self
3636
{
3737
return new static($name, $column);
3838
}
@@ -42,7 +42,7 @@ public static function make(string $name, string $column = null): self
4242
*
4343
* @param string|null $column
4444
*/
45-
public function __construct(string $name, string $column = null)
45+
public function __construct(string $name, ?string $column = null)
4646
{
4747
$this->name = $name;
4848
$this->column = $column ?: $this->guessColumn();

src/ProxySchema.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public function isModel($model): bool
5555
* @param Model|null $model
5656
* @return ProxyContract
5757
*/
58-
public function newProxy(Model $model = null): ProxyContract
58+
public function newProxy(?Model $model = null): ProxyContract
5959
{
6060
$proxyClass = $this->model();
6161

src/QueryBuilder/Applicators/FilterApplicator.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class FilterApplicator
5050
* @param SchemaRelation|null $relation
5151
* @return static
5252
*/
53-
public static function make(Schema $schema, SchemaRelation $relation = null): self
53+
public static function make(Schema $schema, ?SchemaRelation $relation = null): self
5454
{
5555
return new self($schema, $relation);
5656
}

0 commit comments

Comments
 (0)