diff --git a/extensions/package-manager/src/Api/Resource/ExternalExtensionResource.php b/extensions/package-manager/src/Api/Resource/ExternalExtensionResource.php index 0984cbc19..970eca562 100644 --- a/extensions/package-manager/src/Api/Resource/ExternalExtensionResource.php +++ b/extensions/package-manager/src/Api/Resource/ExternalExtensionResource.php @@ -32,7 +32,7 @@ use Tobyz\JsonApiServer\Schema\CustomFilter; class ExternalExtensionResource extends AbstractResource implements Listable, Paginatable, Countable { - protected int|null $totalResults = null; + protected ?int $totalResults = null; public function __construct( protected Repository $cache, diff --git a/framework/core/src/Api/Context.php b/framework/core/src/Api/Context.php index 75b45cc6e..478a74bce 100644 --- a/framework/core/src/Api/Context.php +++ b/framework/core/src/Api/Context.php @@ -108,27 +108,27 @@ class Context extends BaseContext return $this->parameters[$key] ?? $default; } - public function creating(string|null $resource = null): bool + public function creating(?string $resource = null): bool { return $this->endpoint instanceof Endpoint\Create && (! $resource || is_a($this->collection, $resource)); } - public function updating(string|null $resource = null): bool + public function updating(?string $resource = null): bool { return $this->endpoint instanceof Endpoint\Update && (! $resource || is_a($this->collection, $resource)); } - public function deleting(string|null $resource = null): bool + public function deleting(?string $resource = null): bool { return $this->endpoint instanceof Endpoint\Delete && (! $resource || is_a($this->collection, $resource)); } - public function showing(string|null $resource = null): bool + public function showing(?string $resource = null): bool { return $this->endpoint instanceof Endpoint\Show && (! $resource || is_a($this->collection, $resource)); } - public function listing(string|null $resource = null): bool + public function listing(?string $resource = null): bool { return $this->endpoint instanceof Endpoint\Index && (! $resource || is_a($this->collection, $resource)); } diff --git a/framework/core/src/Api/Endpoint/Concerns/HasAuthorization.php b/framework/core/src/Api/Endpoint/Concerns/HasAuthorization.php index e61dcc600..d105ca7e0 100644 --- a/framework/core/src/Api/Endpoint/Concerns/HasAuthorization.php +++ b/framework/core/src/Api/Endpoint/Concerns/HasAuthorization.php @@ -60,7 +60,7 @@ trait HasAuthorization : ($this->authenticated)($context)); } - public function getAuthorized(Context $context): string|null + public function getAuthorized(Context $context): ?string { if (! is_callable($this->ability)) { return $this->ability; diff --git a/framework/core/src/Extend/Link.php b/framework/core/src/Extend/Link.php index 13eff72fb..fe27b7598 100644 --- a/framework/core/src/Extend/Link.php +++ b/framework/core/src/Extend/Link.php @@ -19,8 +19,8 @@ use s9e\TextFormatter\Utils; class Link implements ExtenderInterface { - protected Closure|null $setRel = null; - protected Closure|null $setTarget = null; + protected ?Closure $setRel = null; + protected ?Closure $setTarget = null; public function setRel(Closure $callable): self {