Skip to content
New issue

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

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

Already on GitHub? # to your account

PHP 8.4 deprecation warnings #719

Closed

Conversation

sam-bee
Copy link

@sam-bee sam-bee commented May 13, 2024

Introduction

To avoid PHP 8.4 deprecation warnings, introduce explicitly nullable types where null is used as a default value.

Background

PHP 8.4 will introduce a new deprecation warning, where null is used as a default value, but the typehint is not explicitly nullable. See the PHP 8.4 approved RFC.

This is causing deprecation warnings in downstream projects - see this failing build in Composer.

Solution

Use nullable types in method signatures, wherever null is used as a default value.

Note on PHP versions

The nullable type feature was introduced in PHP 7.1. This pull request proposes a new version of justinrainbow/json-schema which explicitly requires PHP 7.1+. Users of PHP 5.3 - 7.0 would not get this version of the project.

@sam-bee
Copy link
Author

sam-bee commented May 13, 2024

Duplicate of #717 ?

@sam-bee sam-bee closed this May 13, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant