Skip to content

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
@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
Development

Successfully merging this pull request may close these issues.

1 participant