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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
CI: Introduce PHP compatibility check #7844
Draft
Wirone
wants to merge
1
commit into
PHP-CS-Fixer:master
Choose a base branch
from
Wirone:codito/phpcompatibility
base: master
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Wirone
force-pushed
the
codito/phpcompatibility
branch
2 times, most recently
from
February 17, 2024 20:57
787f171
to
ad6eaf7
Compare
Wirone
force-pushed
the
codito/phpcompatibility
branch
from
February 17, 2024 21:01
ad6eaf7
to
9cdb005
Compare
Please don't cc me on other repositories. If you want, you can isolate the bug, reproduce it and report it properly on PHPStan's issue tracker. |
keradus
reviewed
Feb 18, 2024
keradus
reviewed
Feb 26, 2024
Comment on lines
+24
to
+25
<file>../../src/</file> | ||
<file>../../tests/</file> |
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.
I would include the main file too:
Suggested change
<file>../../src/</file> | |
<file>../../tests/</file> | |
<file>../../src/</file> | |
<file>../../tests/</file> | |
<file>../../php-cs-fixer</file> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Inspired by this finding, bug introduced in #7616, reproduced here - we have invalid return type in code and none of the tools caught this. I thought this is because we run PHPStan on 8.3 which then assumes it's valid return type, but I modified
dev-tools/composer.json
, allowed PHP 7.4 and checked on it, but PHPStan still did not report it, even onmax
level. I believe this is a bug (CC: @ondrejmirtes), but anyway I thought maybe it's a good idea to introduce PHPCompatibility check, which is more focused on differences between PHP versions.This is a draft and CI will fail, because we need to decide how we want to handle dynamic usages of PHP consts etc. I believe that sniffs should not report these problems if constant is used in
if
condition, like:but this is separate problem that should be addressed and fixed in long-term (CC: @jrfnl).
PS. There is
10.x-dev as 9.99.0
constraint because10.x
development version has more checks, but at the same time is not compatible withphpcompatibility/phpcompatibility-symfony
which handles Symfony polyfills. We've been using this setup for months in GetResponse and it helped us with migration from 7.4 to 8.2, so I assume it as safe enough 馃檪.