Skip to content

Commit

Permalink
PHP 8.4 updates
Browse files Browse the repository at this point in the history
  • Loading branch information
Torann committed Dec 10, 2024
1 parent 54ca55b commit dc532bd
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 20 deletions.
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@
}
],
"require": {
"php": "^8.0",
"php": "^8.2",
"illuminate/support": "^8.0|^9.0|^10.0|^11.0",
"illuminate/database": "^8.0|^9.0|^10.0|^11.0",
"illuminate/cache": "^8.0|^9.0|^10.0|^11.0"
},
"require-dev": {
"phpunit/phpunit": "^9.0",
"mockery/mockery": "^1.4",
"phpstan/phpstan": "^1.6",
"phpstan/phpstan": "^2.0",
"squizlabs/php_codesniffer": "^3.6"
},
"autoload": {
Expand Down
4 changes: 2 additions & 2 deletions src/Concerns/Cacheable.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public function skippedCache(): bool
*
* @return string
*/
public function getCacheKey(string $method, array $args = null, string $tag = ''): string
public function getCacheKey(string $method, array|null $args = null, string $tag = ''): string
{
// Sort through arguments
foreach ($args as &$a) {
Expand Down Expand Up @@ -98,7 +98,7 @@ public function getCacheKey(string $method, array $args = null, string $tag = ''
*
* @return mixed
*/
public function cacheCallback(string $method, array $args, Closure $callback, int $time = null): mixed
public function cacheCallback(string $method, array $args, Closure $callback, int|null $time = null): mixed
{
// Cache disabled, just execute query & return result
if ($this->skippedCache() === true) {
Expand Down
4 changes: 2 additions & 2 deletions src/Concerns/Messages.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public function hasMessage(string $key = 'message'): bool
/**
* {@inheritDoc}
*/
public function getMessage(string $key = null, string $format = null, string $default = ''): string
public function getMessage(string|null $key = null, string|null $format = null, string $default = ''): string
{
return $this->getMessageBag()->first($key, $format) ?: $default;
}
Expand All @@ -67,7 +67,7 @@ public function hasErrors(): bool
/**
* {@inheritDoc}
*/
public function getErrors(string $format = null): array
public function getErrors(string|null $format = null): array
{
return $this->getMessageBag()->get('error', $format);
}
Expand Down
10 changes: 5 additions & 5 deletions src/Concerns/Ordering.php
Original file line number Diff line number Diff line change
Expand Up @@ -161,11 +161,11 @@ protected function applyOrderableScope(string $column, string $direction): stati
* @return string
*/
public function addOrderByJoin(
Builder $query,
string $joining_table,
string $foreign_key,
string $related_key,
string $alias = null
Builder $query,
string $joining_table,
string $foreign_key,
string $related_key,
string|null $alias = null
): string {
// We need to join to the intermediate table
$local_table = $this->getModel()->getTable();
Expand Down
2 changes: 1 addition & 1 deletion src/Concerns/Scopes.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public function getScopeQuery(): array
*
* @return static
*/
public function addScopeQuery(Closure|Scope $scope, string $key = null): static
public function addScopeQuery(Closure|Scope $scope, string|null $key = null): static
{
if ($scope instanceof Scope && $scope->shouldSkip()) {
return $this;
Expand Down
10 changes: 5 additions & 5 deletions src/Concerns/Searching.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,11 +135,11 @@ public function createSearchClause(
* @return string
*/
public function addSearchJoin(
Builder $query,
string $joining_table,
string $foreign_key,
string $related_key,
string $alias = null
Builder $query,
string $joining_table,
string $foreign_key,
string $related_key,
string|null $alias = null
): string {
// We need to join to the intermediate table
$local_table = $this->getModel()->getTable();
Expand Down
4 changes: 2 additions & 2 deletions src/Contracts/Repository.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ public function count(array $columns = ['*']): int;
*
* @return array<TKey, TValue>
*/
public function pluck(string $value, string $key = null): array;
public function pluck(string $value, string|null $key = null): array;

/**
* Retrieve all data of repository, paginated
Expand Down Expand Up @@ -205,7 +205,7 @@ public function hasMessage(string $key = 'message'): bool;
*
* @return string
*/
public function getMessage(string $key = null, string $format = null, string $default = ''): string;
public function getMessage(string|null $key = null, string|null $format = null, string $default = ''): string;

/**
* Add an error to the message bag
Expand Down
2 changes: 1 addition & 1 deletion src/Repository.php
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ public function count(array $columns = ['*']): int
/**
* {@inheritDoc}
*/
public function pluck(string $value, string $key = null): array
public function pluck(string $value, string|null $key = null): array
{
$this->newQuery();

Expand Down

0 comments on commit dc532bd

Please sign in to comment.