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

PHP 8.4 | BackCompat\Helper: fix implicitly nullable types deprecation notice #568

Merged
merged 1 commit into from
Mar 16, 2024

Conversation

jrfnl
Copy link
Member

@jrfnl jrfnl commented Mar 16, 2024

The $phpcsFile parameter is optional for the getEncoding() and the ignoreAnnotations() method, but the type declaration cannot be made nullable as the minimum supported PHP version of this package is PHP 5.4, while PHP 7.1 is needed for the nullable operator.

Removing the File type declaration effectively widens the type to mixed, which fixes the deprecation notice.

As the class is final, this change does not constitute a BC-break.

Ref: https://wiki.php.net/rfc/deprecate-implicitly-nullable-types

…n notice

The `$phpcsFile` parameter is optional for the `getEncoding()` and the `ignoreAnnotations` method, but the type declaration cannot be made nullable as the minimum supported PHP version of this package is PHP 5.4, while PHP 7.1 is needed for the nullable operator.

Removing the `File` type declaration effectively widens the type to `mixed`, which fixes the deprecation notice.

As the class is `final`, this change does not constitute a BC-break.

Ref: https://wiki.php.net/rfc/deprecate-implicitly-nullable-types
@jrfnl jrfnl added this to the 1.0.x Next milestone Mar 16, 2024
@jrfnl jrfnl merged commit 23ddcad into develop Mar 16, 2024
53 of 54 checks passed
@jrfnl jrfnl deleted the feature/php-8.4-fix-implicitly-nullable-deprecations branch March 16, 2024 05:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant