Skip to content

Commit

Permalink
Prepare for PHP 8.4
Browse files Browse the repository at this point in the history
  • Loading branch information
staudenmeir committed Jul 13, 2024
1 parent fc9dc9c commit c8fe75d
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions src/HasJsonRelationships.php
Original file line number Diff line number Diff line change
Expand Up @@ -322,9 +322,9 @@ public function hasManyThroughJson(
string $related,
string $through,
string|JsonKey $firstKey,
string $secondKey = null,
string $localKey = null,
string|JsonKey $secondLocalKey = null
?string $secondKey = null,
?string $localKey = null,
string|JsonKey|null $secondLocalKey = null
) {
$relationships = [];

Expand Down
2 changes: 1 addition & 1 deletion src/Relations/BelongsToJson.php
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ public function pivotAttributes(Model $model, Model $parent, array $records)
* @param \Illuminate\Database\Eloquent\Model|null $model
* @return array
*/
public function getForeignKeys(Model $model = null)
public function getForeignKeys(?Model $model = null)
{
$model = $model ?: $this->child;

Expand Down
2 changes: 1 addition & 1 deletion src/Relations/Postgres/HasOneOrManyThrough.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ trait HasOneOrManyThrough
* @param \Illuminate\Database\Eloquent\Builder|null $query
* @return void
*/
protected function performJoin(Builder $query = null)
protected function performJoin(?Builder $query = null)
{
$query = $query ?: $this->query;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public function appendToDeepRelationship(array $through, array $foreignKeys, arr
if ($position === 0) {
$foreignKeys[] = $this->ownerKey;

$localKeys[] = function (Builder $query, Builder $parentQuery = null) {
$localKeys[] = function (Builder $query, ?Builder $parentQuery = null) {
if ($parentQuery) {
$this->getRelationExistenceQuery($this->query, $parentQuery);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ trait IsConcatenableHasManyJsonRelation
public function appendToDeepRelationship(array $through, array $foreignKeys, array $localKeys, int $position): array
{
if ($position === 0) {
$foreignKeys[] = function (Builder $query, Builder $parentQuery = null) {
$foreignKeys[] = function (Builder $query, ?Builder $parentQuery = null) {
if ($parentQuery) {
$this->getRelationExistenceQuery($this->query, $parentQuery);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Relations/Traits/IsJsonRelation.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ protected function whereJsonContainsOrMemberOf(
Builder $query,
string $column,
mixed $value,
callable $objectValueCallback = null,
?callable $objectValueCallback = null,
string $boolean = 'and'
): void {
$grammar = $this->getJsonGrammar($query);
Expand Down

0 comments on commit c8fe75d

Please sign in to comment.