Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: php 8.4 #4103

Merged
merged 4 commits into from
Nov 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/REUSABLE_backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ on:
type: string
required: false
# Keep PHP versions synced with build-install-packages.yml
default: '["8.2", "8.3"]'
default: '["8.2", "8.3", "8.4"]'

php_extensions:
description: PHP extensions to install.
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-install-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:

env:
VERSION: ${{ github.event.release.tag_name }}
PHP_VERSIONS: '8.2 8.3'
PHP_VERSIONS: '8.2 8.3 8.4'
INSTALL_PACKAGES_INPUTS: '{ "flarum_version": "{0}", "php_versions": "{1}" }'

jobs:
Expand Down
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
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 @@ -13,13 +13,13 @@

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

public function withFile(string $file = null): self
public function withFile(string $file): self
{
return new self($this->direction, $file);
}
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
luceos marked this conversation as resolved.
Show resolved Hide resolved
{
$discussion = $model ?? new static;

Expand Down
Loading
Loading