Skip to content

Fix PHP 8.4 deprecations #109

@thelem

Description

@thelem

Running this module on PHP 8.4 will generate the following deprecation notices.

Exercise\HTMLPurifierBundle\DependencyInjection\ExerciseHTMLPurifierExtension::getResolvedConfig(): Implicitly marking parameter $definition as nullable is deprecated, the explicit nullable type must be used instead

Exercise\HTMLPurifierBundle\CacheWarmer\SerializerCacheWarmer::warmUp(): Implicitly marking parameter $buildDir as nullable is deprecated, the explicit nullable type must be used instead

The fix is to explictly mark them as nullable (so string = null becomes ?string = null). This syntax was introduced in PHP 7.1 so there are no compatibility concerns as the bundle already requires PHP 8.1 or above.

https://dev.to/gromnan/fix-php-84-deprecation-implicitly-marking-parameter-as-nullable-is-deprecated-the-explicit-nullable-type-must-be-used-instead-5gp3

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