1
0
mirror of https://github.com/flarum/core.git synced 2025-08-02 22:47:33 +02:00

Apply fixes from StyleCI

This commit is contained in:
StyleCI Bot
2025-04-11 09:07:58 +00:00
parent fa88731fe1
commit 2b08c30a22
4 changed files with 9 additions and 9 deletions

View File

@@ -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,

View File

@@ -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));
}

View File

@@ -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;

View File

@@ -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
{