-
Notifications
You must be signed in to change notification settings - Fork 19
Allow php8 #14
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
Allow php8 #14
Conversation
@PowerKiKi : error not related |
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.
Thanks for your contribution. I added a few comments that must be resolved before merging.
There is a bit of chicken-egg problem with the current attempt here:
Thus the initial idea to use I rarely see libraries having It's only relevant for developing this library and is not respected when Just an observation, but maybe I got it backwards! |
Thank you for mentioning the future compatibility of PHPUnit 8 and PHP 8. This is great news and will save a few headaches to many libs.
No, it must not. I am aware that some libraries choose not to commit composer.lock file. But IMHO this has huge downsides, such as introducing unpredictability in CI environnements. This is is clearly illustrated in the first version of this PR where PHP-Cs-Fixer "magically" got upgraded and broke the CI. While some communities are willing and have the resources to track a moving target, I am not and I don't. Keeping the lock is the cheapest solution.
As you noted yourself, this has no incidence whatsoever on consuming users, and is only here to help developers and CI not waste time solving "syncing" issue. Interestingly PHPUnit fails here because somehow composer installs phpunit 4.4.5 (!) 🙄 |
Ok so maybe we need to do a composer update with prefer lowest ? (in an other branch) |
I believe the solution I suggested is the simplest (until sebastianbergmann/phpunit#4533 is released). |
I had a better look and turns out that PHP-Cs-Fixer does not support PHP 8 and prevent us from installing a recent PHPUnit (so we end up with PHPUnit 4.4.5). So until PHP-CS-Fixer/PHP-CS-Fixer#4702 is solved, we need to remove the lock and remove this dependency, but only for PHP 8. Then we can |
b383b78
to
4874109
Compare
@PowerKiKi working and rebased |
|
Much better thank you. The last thing we can improve is always run diff --git .github/workflows/main.yml .github/workflows/main.yml
index ac52d08..3306e9e 100644
--- .github/workflows/main.yml
+++ .github/workflows/main.yml
@@ -30,16 +30,14 @@ jobs:
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
- - name: Install dependencies
- run: composer install
- if: matrix.php-version != '8.0'
-
- name: Update dependencies
+ if: matrix.php-version == '8.0'
run: |
rm composer.lock
composer remove --dev --no-update friendsofphp/php-cs-fixer
- composer update
- if: matrix.php-version == '8.0'
+
+ - name: Install dependencies
+ run: composer install
- name: Setup problem matchers for PHP
run: echo "::add-matcher::${{ runner.tool_cache }}/php.json" |
phpunit 4 is not compatible with php 8 |
Thank you for your contribution, I merged it with the additional modification I mentioned. |
No description provided.