Skip to content

Instantly share code, notes, and snippets.

@ozh
Created May 19, 2021 21:40
Show Gist options
  • Save ozh/6d157b62d33551677b104e1c17c16041 to your computer and use it in GitHub Desktop.
Save ozh/6d157b62d33551677b104e1c17c16041 to your computer and use it in GitHub Desktop.
Check platform requirement with Composer

You can easily do a baseline test of whether your dependencies support PHP 8 using Composer's platform config by running for example:

composer config platform.php 8.0.5

# Checks whether latest versions of your dependencies (according to your
# version constraints) allow PHP 8
composer update --dry-run         

# Checks whether current versions of your deps allow PHP 8
composer update nothing --dry-run 

If this passes, you can try to actually do an update without --dry-run and run your test suite. If you get solver errors then you may need to look whether a new version exists for these dependencies, or send them a PR / open an issue about PHP 8 support.

Don't forget to revert composer.json changes to the platform config once you're done.

Source: https://blog.packagist.com/php-versions-stats-2021-1-edition/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment