drush-ops / drush

Drush is a command-line shell and scripting interface for Drupal, a veritable Swiss Army knife designed to make life easier for those who spend their working hours hacking away at the command prompt.
https://www.drush.org
2.33k stars 1.08k forks source link

PHP 8.4 compatibility #6069

Open andypost opened 1 month ago

andypost commented 1 month ago

PHP 8.4 alpha2 is out and php -l passes on 13.x branch but some vendor dependencies need fixes

General function deprecation is coming https://wiki.php.net/rfc/deprecations_php_8_4 But for now nullable-declarations can be fixed https://php.watch/versions/8.4/implicitly-marking-parameter-type-nullable-deprecated

external dependencies

andypost commented 1 month ago

Using oneliner find . -name '*.php' -exec php -l {} \;

And search in vendor find vendor -name "*.php" -exec sh -c 'php -l "$1" 2>&1 | grep -v "No syntax errors detected in" || true' _ {} \; > php84-vendor.log

php84-vendor.log

andypost commented 1 month ago

Using official docker image docker run --rm -v $(pwd):/mnt -w /mnt php:8.4.0alpha2-cli-alpine find src -type f -name '*.php' -exec php -l {} \;

andypost commented 1 month ago

Needs update symfony/polyfill-mbstring to 1.30.0 for https://github.com/symfony/polyfill-mbstring/commit/e5e7ddb00b859dbdf5ad8f3bbe4cd29a3a37aa34 and 1.30.0 for https://github.com/symfony/polyfill-php83/commit/4101e9edae47b36671a91857ab6cd359024faabd

andypost commented 1 month ago

also needs upgrade PhpStan but few of its dependencies not yet ready too

andypost commented 1 month ago

Example use of 8.4 in CI https://github.com/mck89/peast/commit/97dd57fb5bf58408361f906898646ac90fa278d0

weitzman commented 1 month ago

Thanks for this work, @andypost and @greg-1-anderson. Looks like the dependencies are making progress.

andypost commented 2 days ago

Please create new release for https://github.com/consolidation/annotated-command/pull/311