Skip to content

Commit

Permalink
chore: fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
SychO9 committed Nov 7, 2024
1 parent 5978571 commit cd3af7f
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion framework/core/src/Api/Resource/Concerns/HasHooks.php
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ public function deleted(object $model, Context $context): void
//
}

public function dispatchEventsFor(mixed $entity, User $actor = null): void
public function dispatchEventsFor(mixed $entity, ?User $actor = null): void
{
if (method_exists($entity, 'releaseEvents')) {
$this->traitDispatchEventsFor($entity, $actor);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public function __construct(protected string $direction, ?string $file = null)
parent::__construct("Migration file $fileNameWithSpace should contain an array with up/down (looking for $direction)");
}

public function withFile(string $file = null): self
public function withFile(?string $file = null): self
{
return new self($this->direction, $file);
}
Expand Down
6 changes: 3 additions & 3 deletions framework/core/src/Extend/ApiResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public function endpoints(callable|string $endpoints): self
* @param array $endpoints must be an array of names of the endpoints.
* @param callable|class-string|null $condition a callable that returns a boolean or a string that represents whether this should be applied.
*/
public function removeEndpoints(array $endpoints, callable|string $condition = null): self
public function removeEndpoints(array $endpoints, callable|string|null $condition = null): self
{
$this->removeEndpoints[] = [$endpoints, $condition];

Expand Down Expand Up @@ -99,7 +99,7 @@ public function fields(callable|string $fields): self
* @param array $fields must be an array of field names.
* @param callable|class-string|null $condition a callable that returns a boolean or a string that represents whether this should be applied.
*/
public function removeFields(array $fields, callable|string $condition = null): self
public function removeFields(array $fields, callable|string|null $condition = null): self
{
$this->removeFields[] = [$fields, $condition];

Expand Down Expand Up @@ -139,7 +139,7 @@ public function sorts(callable|string $sorts): self
* @param array $sorts must be an array of sort names.
* @param callable|class-string|null $condition a callable that returns a boolean or a string that represents whether this should be applied.
*/
public function removeSorts(array $sorts, callable|string $condition = null): self
public function removeSorts(array $sorts, callable|string|null $condition = null): self
{
$this->removeSorts[] = [$sorts, $condition];

Expand Down
2 changes: 1 addition & 1 deletion framework/core/src/Extend/Frontend.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public function jsDirectory(string $path): self
*
* @return self
*/
public function route(string $path, string $name, callable|string $content = null): self
public function route(string $path, string $name, callable|string|null $content = null): self
{
$this->routes[] = compact('path', 'name', 'content');

Expand Down
4 changes: 2 additions & 2 deletions framework/core/src/Extend/Settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class Settings implements ExtenderInterface
*
* @return self
*/
public function serializeToForum(string $attributeName, string $key, callable|string $callback = null): self
public function serializeToForum(string $attributeName, string $key, callable|string|null $callback = null): self
{
$this->settings[$key] = compact('attributeName', 'callback');

Expand Down Expand Up @@ -94,7 +94,7 @@ public function resetWhen(string $key, callable|string $callback): self
*
* @return self
*/
public function registerLessConfigVar(string $configName, string $key, callable|string $callback = null): self
public function registerLessConfigVar(string $configName, string $key, callable|string|null $callback = null): self
{
$this->lessConfigs[$configName] = compact('key', 'callback');

Expand Down
2 changes: 1 addition & 1 deletion framework/core/src/Extend/Theme.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public function overrideLessImport(string $file, string $newFilePath, ?string $e
* @param string|null $extensionId : If overriding an extension file, specify its ID, for example: `flarum-tags`.
* @return self
*/
public function overrideFileSource(string $file, string $newFilePath, string $extensionId = null): self
public function overrideFileSource(string $file, string $newFilePath, ?string $extensionId = null): self
{
$this->fileSourceOverrides[] = compact('file', 'newFilePath', 'extensionId');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class ExtensionBootError extends Exception
public function __construct(
public Extension $extension,
public object $extender,
Throwable $previous = null
?Throwable $previous = null
) {
$extenderClass = $extender::class;

Expand Down

0 comments on commit cd3af7f

Please sign in to comment.