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 d710e38 commit 5978571
Show file tree
Hide file tree
Showing 88 changed files with 102 additions and 97 deletions.
2 changes: 1 addition & 1 deletion extensions/akismet/tests/phpunit.integration.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd"
xsi:noNamespaceSchemaLocation="../../../vendor/phpunit/phpunit/phpunit.xsd"
backupGlobals="false"
cacheDirectory=".phpunit.cache"
backupStaticProperties="false"
Expand Down
2 changes: 1 addition & 1 deletion extensions/akismet/tests/phpunit.unit.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd"
xsi:noNamespaceSchemaLocation="../../../vendor/phpunit/phpunit/phpunit.xsd"
backupGlobals="false"
cacheDirectory=".phpunit.cache"
backupStaticProperties="false"
Expand Down
2 changes: 1 addition & 1 deletion extensions/approval/tests/phpunit.integration.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd"
xsi:noNamespaceSchemaLocation="../../../vendor/phpunit/phpunit/phpunit.xsd"
backupGlobals="false"
cacheDirectory=".phpunit.cache"
backupStaticProperties="false"
Expand Down
2 changes: 1 addition & 1 deletion extensions/approval/tests/phpunit.unit.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd"
xsi:noNamespaceSchemaLocation="../../../vendor/phpunit/phpunit/phpunit.xsd"
backupGlobals="false"
cacheDirectory=".phpunit.cache"
backupStaticProperties="false"
Expand Down
2 changes: 1 addition & 1 deletion extensions/flags/tests/phpunit.integration.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd"
xsi:noNamespaceSchemaLocation="../../../vendor/phpunit/phpunit/phpunit.xsd"
backupGlobals="false"
cacheDirectory=".phpunit.cache"
backupStaticProperties="false"
Expand Down
2 changes: 1 addition & 1 deletion extensions/flags/tests/phpunit.unit.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd"
xsi:noNamespaceSchemaLocation="../../../vendor/phpunit/phpunit/phpunit.xsd"
backupGlobals="false"
cacheDirectory=".phpunit.cache"
backupStaticProperties="false"
Expand Down
6 changes: 3 additions & 3 deletions extensions/likes/tests/integration/api/LikePostTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ protected function rewriteDefaultPermissionsAfterBoot()

#[Test]
#[DataProvider('allowedUsersToLike')]
public function can_like_a_post_if_allowed(int $postId, ?int $authenticatedAs, string $message, bool $canLikeOwnPost = null)
public function can_like_a_post_if_allowed(int $postId, ?int $authenticatedAs, string $message, ?bool $canLikeOwnPost = null)
{
if (! is_null($canLikeOwnPost)) {
$this->setting('flarum-likes.like_own_post', $canLikeOwnPost);
Expand All @@ -82,7 +82,7 @@ public function can_like_a_post_if_allowed(int $postId, ?int $authenticatedAs, s

#[Test]
#[DataProvider('unallowedUsersToLike')]
public function cannot_like_a_post_if_not_allowed(int $postId, ?int $authenticatedAs, string $message, bool $canLikeOwnPost = null)
public function cannot_like_a_post_if_not_allowed(int $postId, ?int $authenticatedAs, string $message, ?bool $canLikeOwnPost = null)
{
if (! is_null($canLikeOwnPost)) {
$this->setting('flarum-likes.like_own_post', $canLikeOwnPost);
Expand All @@ -100,7 +100,7 @@ public function cannot_like_a_post_if_not_allowed(int $postId, ?int $authenticat

#[Test]
#[DataProvider('allowedUsersToLike')]
public function can_dislike_a_post_if_liked_and_allowed(int $postId, ?int $authenticatedAs, string $message, bool $canLikeOwnPost = null)
public function can_dislike_a_post_if_liked_and_allowed(int $postId, ?int $authenticatedAs, string $message, ?bool $canLikeOwnPost = null)
{
if (! is_null($canLikeOwnPost)) {
$this->setting('flarum-likes.like_own_post', $canLikeOwnPost);
Expand Down
2 changes: 1 addition & 1 deletion extensions/likes/tests/phpunit.integration.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd"
xsi:noNamespaceSchemaLocation="../../../vendor/phpunit/phpunit/phpunit.xsd"
backupGlobals="false"
cacheDirectory=".phpunit.cache"
backupStaticProperties="false"
Expand Down
2 changes: 1 addition & 1 deletion extensions/likes/tests/phpunit.unit.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd"
xsi:noNamespaceSchemaLocation="../../../vendor/phpunit/phpunit/phpunit.xsd"
backupGlobals="false"
cacheDirectory=".phpunit.cache"
backupStaticProperties="false"
Expand Down
2 changes: 1 addition & 1 deletion extensions/lock/src/Post/DiscussionLockedPost.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class DiscussionLockedPost extends AbstractEventPost implements MergeableInterfa
{
public static string $type = 'discussionLocked';

public function saveAfter(Post $previous = null): static
public function saveAfter(?Post $previous = null): static
{
// If the previous post is another 'discussion locked' post, and it's
// by the same user, then we can merge this post into it. If we find
Expand Down
2 changes: 1 addition & 1 deletion extensions/mentions/src/Formatter/FormatTagMentions.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

class FormatTagMentions
{
public function __invoke(Renderer $renderer, mixed $context, string $xml, Request $request = null): string
public function __invoke(Renderer $renderer, mixed $context, string $xml, ?Request $request = null): string
{
return Utils::replaceAttributes($xml, 'TAGMENTION', function ($attributes) use ($context) {
/** @var Tag|null $tag */
Expand Down
2 changes: 1 addition & 1 deletion extensions/mentions/tests/phpunit.integration.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd"
xsi:noNamespaceSchemaLocation="../../../vendor/phpunit/phpunit/phpunit.xsd"
backupGlobals="false"
cacheDirectory=".phpunit.cache"
backupStaticProperties="false"
Expand Down
2 changes: 1 addition & 1 deletion extensions/mentions/tests/phpunit.unit.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd"
xsi:noNamespaceSchemaLocation="../../../vendor/phpunit/phpunit/phpunit.xsd"
backupGlobals="false"
cacheDirectory=".phpunit.cache"
backupStaticProperties="false"
Expand Down
2 changes: 1 addition & 1 deletion extensions/messages/tests/phpunit.integration.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd"
xsi:noNamespaceSchemaLocation="../../../vendor/phpunit/phpunit/phpunit.xsd"
backupGlobals="false"
cacheDirectory=".phpunit.cache"
backupStaticProperties="false"
Expand Down
2 changes: 1 addition & 1 deletion extensions/messages/tests/phpunit.unit.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd"
xsi:noNamespaceSchemaLocation="../../../vendor/phpunit/phpunit/phpunit.xsd"
backupGlobals="false"
cacheDirectory=".phpunit.cache"
backupStaticProperties="false"
Expand Down
2 changes: 1 addition & 1 deletion extensions/nicknames/tests/phpunit.integration.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd"
xsi:noNamespaceSchemaLocation="../../../vendor/phpunit/phpunit/phpunit.xsd"
backupGlobals="false"
cacheDirectory=".phpunit.cache"
backupStaticProperties="false"
Expand Down
2 changes: 1 addition & 1 deletion extensions/nicknames/tests/phpunit.unit.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd"
xsi:noNamespaceSchemaLocation="../../../vendor/phpunit/phpunit/phpunit.xsd"
backupGlobals="false"
cacheDirectory=".phpunit.cache"
backupStaticProperties="false"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class SetupComposer

private $config;

public function __construct(array $config = null)
public function __construct(?array $config = null)
{
$this->config = $config;
}
Expand Down
2 changes: 1 addition & 1 deletion extensions/package-manager/tests/phpunit.integration.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd"
xsi:noNamespaceSchemaLocation="../../../vendor/phpunit/phpunit/phpunit.xsd"
backupGlobals="false"
cacheDirectory=".phpunit.cache"
backupStaticProperties="false"
Expand Down
2 changes: 1 addition & 1 deletion extensions/package-manager/tests/phpunit.unit.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd"
xsi:noNamespaceSchemaLocation="../../../vendor/phpunit/phpunit/phpunit.xsd"
backupGlobals="false"
cacheDirectory=".phpunit.cache"
backupStaticProperties="false"
Expand Down
2 changes: 1 addition & 1 deletion extensions/statistics/tests/phpunit.integration.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd"
xsi:noNamespaceSchemaLocation="../../../vendor/phpunit/phpunit/phpunit.xsd"
backupGlobals="false"
cacheDirectory=".phpunit.cache"
backupStaticProperties="false"
Expand Down
2 changes: 1 addition & 1 deletion extensions/statistics/tests/phpunit.unit.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd"
xsi:noNamespaceSchemaLocation="../../../vendor/phpunit/phpunit/phpunit.xsd"
backupGlobals="false"
cacheDirectory=".phpunit.cache"
backupStaticProperties="false"
Expand Down
2 changes: 1 addition & 1 deletion extensions/sticky/src/Post/DiscussionStickiedPost.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class DiscussionStickiedPost extends AbstractEventPost implements MergeableInter
{
public static string $type = 'discussionStickied';

public function saveAfter(Post $previous = null): static
public function saveAfter(?Post $previous = null): static
{
// If the previous post is another 'discussion stickied' post, and it's
// by the same user, then we can merge this post into it. If we find
Expand Down
2 changes: 1 addition & 1 deletion extensions/sticky/tests/phpunit.integration.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd"
xsi:noNamespaceSchemaLocation="../../../vendor/phpunit/phpunit/phpunit.xsd"
backupGlobals="false"
cacheDirectory=".phpunit.cache"
backupStaticProperties="false"
Expand Down
2 changes: 1 addition & 1 deletion extensions/sticky/tests/phpunit.unit.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd"
xsi:noNamespaceSchemaLocation="../../../vendor/phpunit/phpunit/phpunit.xsd"
backupGlobals="false"
cacheDirectory=".phpunit.cache"
backupStaticProperties="false"
Expand Down
2 changes: 1 addition & 1 deletion extensions/subscriptions/tests/phpunit.integration.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd"
xsi:noNamespaceSchemaLocation="../../../vendor/phpunit/phpunit/phpunit.xsd"
backupGlobals="false"
cacheDirectory=".phpunit.cache"
backupStaticProperties="false"
Expand Down
2 changes: 1 addition & 1 deletion extensions/subscriptions/tests/phpunit.unit.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd"
xsi:noNamespaceSchemaLocation="../../../vendor/phpunit/phpunit/phpunit.xsd"
backupGlobals="false"
cacheDirectory=".phpunit.cache"
backupStaticProperties="false"
Expand Down
2 changes: 1 addition & 1 deletion extensions/suspend/tests/phpunit.integration.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd"
xsi:noNamespaceSchemaLocation="../../../vendor/phpunit/phpunit/phpunit.xsd"
backupGlobals="false"
cacheDirectory=".phpunit.cache"
backupStaticProperties="false"
Expand Down
2 changes: 1 addition & 1 deletion extensions/suspend/tests/phpunit.unit.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd"
xsi:noNamespaceSchemaLocation="../../../vendor/phpunit/phpunit/phpunit.xsd"
backupGlobals="false"
cacheDirectory=".phpunit.cache"
backupStaticProperties="false"
Expand Down
2 changes: 1 addition & 1 deletion extensions/tags/src/Post/DiscussionTaggedPost.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class DiscussionTaggedPost extends AbstractEventPost implements MergeableInterfa
{
public static string $type = 'discussionTagged';

public function saveAfter(Post $previous = null): static
public function saveAfter(?Post $previous = null): static
{
// If the previous post is another 'discussion tagged' post, and it's
// by the same user, then we can merge this post into it. If we find
Expand Down
2 changes: 1 addition & 1 deletion extensions/tags/src/Tag.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ public function refreshLastPostedDiscussion(): static
return $this;
}

public function setLastPostedDiscussion(Discussion $discussion = null): static
public function setLastPostedDiscussion(?Discussion $discussion = null): static
{
$this->last_posted_at = optional($discussion)->last_posted_at;
$this->last_posted_discussion_id = optional($discussion)->id;
Expand Down
6 changes: 3 additions & 3 deletions extensions/tags/src/TagRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public function queryVisibleTo(?User $actor = null): Builder
* Find a tag by ID, optionally making sure it is visible to a certain
* user, or throw an exception.
*/
public function findOrFail(int $id, User $actor = null): Tag
public function findOrFail(int $id, ?User $actor = null): Tag
{
$query = Tag::where('id', $id);

Expand All @@ -45,7 +45,7 @@ public function findOrFail(int $id, User $actor = null): Tag
*
* @return Collection<int, Tag>
*/
public function all(User $user = null): Collection
public function all(?User $user = null): Collection
{
$query = Tag::query();

Expand All @@ -55,7 +55,7 @@ public function all(User $user = null): Collection
/**
* Get the ID of a tag with the given slug.
*/
public function getIdForSlug(string $slug, User $user = null): ?int
public function getIdForSlug(string $slug, ?User $user = null): ?int
{
$query = Tag::where('slug', $slug);

Expand Down
2 changes: 1 addition & 1 deletion extensions/tags/tests/phpunit.integration.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd"
xsi:noNamespaceSchemaLocation="../../../vendor/phpunit/phpunit/phpunit.xsd"
backupGlobals="false"
cacheDirectory=".phpunit.cache"
backupStaticProperties="false"
Expand Down
2 changes: 1 addition & 1 deletion extensions/tags/tests/phpunit.unit.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd"
xsi:noNamespaceSchemaLocation="../../../vendor/phpunit/phpunit/phpunit.xsd"
backupGlobals="false"
cacheDirectory=".phpunit.cache"
backupStaticProperties="false"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

class MigrationKeyMissing extends Exception
{
public function __construct(protected string $direction, string $file = null)
public function __construct(protected string $direction, ?string $file = null)
{
$fileNameWithSpace = $file ? ' '.realpath($file) : '';
parent::__construct("Migration file $fileNameWithSpace should contain an array with up/down (looking for $direction)");
Expand Down
2 changes: 1 addition & 1 deletion framework/core/src/Discussion/Discussion.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ public static function boot()
/**
* Start a new discussion. Raises the DiscussionWasStarted event.
*/
public static function start(?string $title, User $user, self $model = null): self
public static function start(?string $title, User $user, ?self $model = null): self
{
$discussion = $model ?? new static;

Expand Down
2 changes: 1 addition & 1 deletion framework/core/src/Extend/ApiResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ public function sort(string|array $sort, callable|string $mutator): self
return $this;
}

public function extend(Container $container, Extension $extension = null): void
public function extend(Container $container, ?Extension $extension = null): void
{
if (! (new ReflectionClass($this->resourceClass))->isAbstract()) {
$container->extend('flarum.api.resources', function (array $resources) {
Expand Down
2 changes: 1 addition & 1 deletion framework/core/src/Extend/Auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public function removePasswordChecker(string $identifier): self
return $this;
}

public function extend(Container $container, Extension $extension = null): void
public function extend(Container $container, ?Extension $extension = null): void
{
$container->extend('flarum.user.password_checkers', function ($passwordCheckers) use ($container) {
foreach ($this->removePasswordCheckers as $identifier) {
Expand Down
2 changes: 1 addition & 1 deletion framework/core/src/Extend/Conditional.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public function when(callable|bool $condition, callable|string $extenders): self
* @param Extension|null $extension
* @return void
*/
public function extend(Container $container, Extension $extension = null): void
public function extend(Container $container, ?Extension $extension = null): void
{
foreach ($this->conditions as $condition) {
if (is_callable($condition['condition'])) {
Expand Down
2 changes: 1 addition & 1 deletion framework/core/src/Extend/Console.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public function schedule(string $command, callable|string $callback, array $args
return $this;
}

public function extend(Container $container, Extension $extension = null): void
public function extend(Container $container, ?Extension $extension = null): void
{
$container->extend('flarum.console.commands', function ($existingCommands) {
return array_merge($existingCommands, $this->addCommands);
Expand Down
Loading

0 comments on commit 5978571

Please sign in to comment.