-
Notifications
You must be signed in to change notification settings - Fork 5
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
Issue #4 - Support for PHP 8.2 #5
Conversation
I'm a bit conflicted here: you using As this change is addressing a PHP 8+ problem, I looked into a small upgrade for PHP 8, updating PHPUnit, adding some types, but keeping the interfaces compatible. To have a minor release and keep the stack working, maybe it would be possible to
This feels like a lightweight approach to me. @Sweetchuck does that make sense to you? |
I saw the PHP requirements in .travis-ci.yml, (5.6, 7.0), and the phpunit-5 in composer.json, and I knew that there would be a lot of difficulties to make everything work together. That is why I didn't touch those things. I forgot to check when was the |
Not trivial, but I can write a CI pipeline which runs from PHP 5.6 to 8.3 by using different phpunit versions and refactor the custom test classes, maybe even duplicate them if necessary. |
7.2 seems reasonable to me, if it's just changing PHPUnit. For my PHP 8 test all it took was a migration to phpunit.xml provided by the package (and a return-type on a To identify the packages I don't really have a good idea. I was hoping for something like WeakMap, but that became available with PHP 8. So I would suggest just going the 7.2 way. I can't really judge the CI solutions. Travis and coveralls was a test at the time, but I'm not really attached to it and I didn't use much cloud CI in the last years. In your 2.x branch I see you switched to GH actions. Maybe a minimal 7.2 PHPUnit action is an option? |
b0c415b
to
c2c06d1
Compare
c2c06d1
to
4000463
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you very much for your work, I really like the cleanup.
I added some questions looking through your changes.
Settings / Editor / Inspections / PHP / General
Of course, it could be turned off, but maybe some day it will protect me from a real problem :-) |
I have created this already for my Bettergist Collector project, which while unfortnately is proprietary, I can just gift you the CI/CD script... The Bettergist Collector downloads, continuously, every single reachable package in Packagist.org, and then runs a whole host of CI/CD + static analysis on them, including phpstan, phpunit (if they have tests), etc., against every version of PHP from 5.6 through 8.3, as supported by each project. To do this, I utilize my phpexperts/dockerize project. It is the simplist and most complete way to dockerize any and every PHP project, from PHP 5.6 and beyond. I have even written proprietary dockerfiles to support PHP 4.4 for huge multinationals based on that project. In fact, I can say with full scientific accuracy that I have successfully dockerized 98% of all of the 369,394 packagist projects, with the remaining 2% being bugged in some terrible way (like critical parse errors preventing autoloading). composer require phpexperts/dockerize
hash -r
PHP_VERSION=8.1 composer install
PHP_VERSION=8.1 phpunit It uses the latest composer internally inside the docker image. With all that said, here's the CI/CD system that will test your code against everything: #!/bin/bash
rm -rf composer.lock vendor
# First, bootstrap with a PHP version known to work.
PHP_VERSION=7.2 composer install
time for PHPV in 5.6 7.2 7.3 7.4 8.0 8.1 8.2; do
echo "PHP Version: $PHPV"
PHP_VERSION=$PHPV composer update
PHP_VERSION=$PHPV phpunit
done How to support PHPUnit 5-9 and then add support for 10 and 11 is not trivial. A good example of how to do it is at https://github.com/PHPExpertsInc/RESTSpeaker. |
Issue #4