Skip to content

PHP 8.4 Implicitly marking parameter as nullable is deprecated #2038

Open
@eelkevdbos

Description

@eelkevdbos

Since PHP 8.4, implicit nullables raise a rather persistent deprecation warning.

Example:

PHP message: PHP Deprecated:  NoteQuery::withCreatorQuery(): Implicitly marking parameter $relationAlias as nullable is deprecated, the explicit nullable type must be used instead in NoteQuery.php on line ...;

Solution:

Use strict nullable types instead of null as a default value in model and query generation e.g.:

function withCreatorQuery(callable $callable, ?string $relationAlias = null, ?string $joinType = 'left join') { ... }

Instead of:

function withCreatorQuery(callable $callable, string $relationAlias = null, ?string $joinType = 'left join') { ... }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions