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

Prepare dependencies for deprecation of implicitly nullable parameter types in PHP 8.4 #5719

Closed
10 of 40 tasks
sebastianbergmann opened this issue Mar 2, 2024 · 6 comments
Closed
10 of 40 tasks
Assignees
Labels
type/change-in-php-requires-adaptation A change in PHP requires a change so that existing PHPUnit functionality continues to work version/8 Something affects PHPUnit 8 version/9 Something affects PHPUnit 9 version/10 Something affects PHPUnit 10 version/11 Something affects PHPUnit 11

Comments

@sebastianbergmann
Copy link
Owner

sebastianbergmann commented Mar 2, 2024

@kocsismate put forward an RFC to deprecate implicitly nullable parameter types for PHP 8.4.

PHPUnit >= 8.5 as well as its dependencies need to be updated to not trigger the respective deprecation warning.

I have already updated PHPUnit's own code on the 8.5, 9.6, 10.5, 11.0, and main branches as well as the code of PHPUnit's dependencies for which I am also responsible.

I used this fork of @kocsismate's script to find implicitly nullable parameter types in PHPUnit's own code as well as its dependencies.

Below is a list of implicitly nullable parameter types in PHPUnit's dependencies, shown per PHPUnit version, that are not under my control.

@theseer and I discussed that I will create pull requests for phar-io/manifest and theseer/tokenizer that he will merge. New releases of these two packages without implicitly nullable parameter types should be tagged within the next few days.

@nikic Would you accept a pull request for nikic/php-parser version 4.18 that removes implicitly nullable parameter types? If so, I would prepare that.

PHPUnit 8.5 (8.5 branch)

  • vendor/phar-io/manifest/src/values/Manifest.php:78 (from phar-io/manifest version 2.0.3 by @theseer)
  • vendor/theseer/tokenizer/src/XMLSerializer.php:22 (from theseer/tokenizer version 1.2.2 by @theseer)

PHPUnit 9.6 (9.6 branch)

  • vendor/phar-io/manifest/src/values/Manifest.php:78 (from phar-io/manifest version 2.0.3 by @theseer)
  • vendor/theseer/tokenizer/src/XMLSerializer.php:22 (from theseer/tokenizer version 1.2.2 by @theseer)
  • vendor/nikic/php-parser/lib/PhpParser/ConstExprEvaluator.php:40 (from nikic/php-parser version 4.18.0 by @nikic)
  • vendor/nikic/php-parser/lib/PhpParser/Internal/PrintableNewAnonClassNode.php:34 (from nikic/php-parser version 4.18.0 by @nikic)
  • vendor/nikic/php-parser/lib/PhpParser/Lexer.php:72 (from nikic/php-parser version 4.18.0 by @nikic)
  • vendor/nikic/php-parser/lib/PhpParser/Lexer/Emulative.php:77 (from nikic/php-parser version 4.18.0 by @nikic)
  • vendor/nikic/php-parser/lib/PhpParser/NameContext.php:39 (from nikic/php-parser version 4.18.0 by @nikic)
  • vendor/nikic/php-parser/lib/PhpParser/Node/Arg.php:30 (from nikic/php-parser version 4.18.0 by @nikic)
  • vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ArrayDimFetch.php:21 (from nikic/php-parser version 4.18.0 by @nikic)
  • vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ArrayItem.php:26 (from nikic/php-parser version 4.18.0 by @nikic)
  • vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Exit_.php:22 (from nikic/php-parser version 4.18.0 by @nikic)
  • vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Yield_.php:21 (from nikic/php-parser version 4.18.0 by @nikic)
  • vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Yield_.php:21 (from nikic/php-parser version 4.18.0 by @nikic)
  • vendor/nikic/php-parser/lib/PhpParser/Node/Name.php:165 (from nikic/php-parser version 4.18.0 by @nikic)
  • vendor/nikic/php-parser/lib/PhpParser/Node/Param.php:37 (from nikic/php-parser version 4.18.0 by @nikic)
  • vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Break_.php:18 (from nikic/php-parser version 4.18.0 by @nikic)
  • vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Catch_.php:26 (from nikic/php-parser version 4.18.0 by @nikic)
  • vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Continue_.php:18 (from nikic/php-parser version 4.18.0 by @nikic)
  • vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Declare_.php:21 (from nikic/php-parser version 4.18.0 by @nikic)
  • vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/EnumCase.php:23 (from nikic/php-parser version 4.18.0 by @nikic)
  • vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Namespace_.php:25 (from nikic/php-parser version 4.18.0 by @nikic)
  • vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/PropertyProperty.php:21 (from nikic/php-parser version 4.18.0 by @nikic)
  • vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Return_.php:18 (from nikic/php-parser version 4.18.0 by @nikic)
  • vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/StaticVar.php:23 (from nikic/php-parser version 4.18.0 by @nikic)
  • vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/TryCatch.php:24 (from nikic/php-parser version 4.18.0 by @nikic)
  • vendor/nikic/php-parser/lib/PhpParser/NodeDumper.php:42 (from nikic/php-parser version 4.18.0 by @nikic)
  • vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/NameResolver.php:38 (from nikic/php-parser version 4.18.0 by @nikic)
  • vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/NameResolver.php:167 (from nikic/php-parser version 4.18.0 by @nikic)
  • vendor/nikic/php-parser/lib/PhpParser/Parser.php:17 (from nikic/php-parser version 4.18.0 by @nikic)
  • vendor/nikic/php-parser/lib/PhpParser/Parser/Multiple.php:27 (from nikic/php-parser version 4.18.0 by @nikic)
  • vendor/nikic/php-parser/lib/PhpParser/ParserAbstract.php:158 (from nikic/php-parser version 4.18.0 by @nikic)
  • vendor/nikic/php-parser/lib/PhpParser/ParserFactory.php:24 (from nikic/php-parser version 4.18.0 by @nikic)

PHPUnit 10.5 (10.5 branch)

  • vendor/phar-io/manifest/src/values/Manifest.php:78 (from phar-io/manifest version 2.0.3 by @theseer)
  • vendor/theseer/tokenizer/src/XMLSerializer.php:22 (from theseer/tokenizer version 1.2.2 by @theseer)

PHPUnit 11.0 (11.0 branch)

  • vendor/phar-io/manifest/src/values/Manifest.php:78 (from phar-io/manifest version 2.0.3 by @theseer)
  • vendor/theseer/tokenizer/src/XMLSerializer.php:22 (from theseer/tokenizer version 1.2.2 by @theseer)

PHPUnit 11.1 (main branch)

  • vendor/phar-io/manifest/src/values/Manifest.php:78 (from phar-io/manifest version 2.0.3 by @theseer)
  • vendor/theseer/tokenizer/src/XMLSerializer.php:22 (from theseer/tokenizer version 1.2.2 by @theseer)
@sebastianbergmann sebastianbergmann added the type/change-in-php-requires-adaptation A change in PHP requires a change so that existing PHPUnit functionality continues to work label Mar 2, 2024
@sebastianbergmann sebastianbergmann self-assigned this Mar 2, 2024
@nikic
Copy link

nikic commented Mar 2, 2024

@nikic Would you accept a pull request for nikic/php-parser version 4.18 that removes implicitly nullable parameter types? If so, I would prepare that.

The minimum version for PHP-Parser 4 is PHP 7.0, which doesn't have nullable types :( I don't like raising PHP version requirements in minor versions, but I guess there's not really a choice here. Per composers PHP version stats (https://packagist.org/packages/nikic/php-parser/php-stats) usage of PHP 7.0 with PHP-Parser 4 is at 0.2%, so it should be fairly low impact at least.

@sebastianbergmann
Copy link
Owner Author

sebastianbergmann commented Mar 2, 2024

The minimum version for PHP-Parser 4 is PHP 7.0, which doesn't have nullable types :( I don't like raising PHP version requirements in minor versions, but I guess there's not really a choice here. Per composers PHP version stats (https://packagist.org/packages/nikic/php-parser/php-stats) usage of PHP 7.0 with PHP-Parser 4 is at 0.2%, so it should be fairly low impact at least.

@nikic Just to clarify: I will prepare a pull request that raises the PHP version requirement to PHP 7.1 and removes implicitly nullable parameter types?

@nikic
Copy link

nikic commented Mar 2, 2024

@sebastianbergmann Yeah, sounds good!

@theseer
Copy link
Collaborator

theseer commented Mar 3, 2024

phar.io/manifest and theseer/tokenizer have been updated, the respective releases tagged.

@sebastianbergmann
Copy link
Owner Author

I fully @nikic will release PHP-Parser 4.19 with nikic/PHP-Parser#984 before PHP 8.4 is released. Therefore, I close this issue.

@nikic
Copy link

nikic commented Mar 17, 2024

PHP-Parser 4.19 is released now.

mbeccati added a commit to mbeccati/phpunit that referenced this issue Mar 18, 2024
sebastianbergmann pushed a commit that referenced this issue Mar 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/change-in-php-requires-adaptation A change in PHP requires a change so that existing PHPUnit functionality continues to work version/8 Something affects PHPUnit 8 version/9 Something affects PHPUnit 9 version/10 Something affects PHPUnit 10 version/11 Something affects PHPUnit 11
Projects
None yet
Development

No branches or pull requests

3 participants