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
Utilize composer min-php version to narrow PHP_VERSION_ID #2968
Open
staabm
wants to merge
19
commits into
phpstan:1.10.x
Choose a base branch
from
staabm:min-php
base: 1.10.x
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.
Open
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
9dd5d00
Utilize composer min-php version to narrow PHP_VERSION_ID
staabm d19e18b
fix
staabm 914c39d
Update e2e-tests.yml
staabm 5bf2853
add more tests
staabm 282b350
fix
staabm 1081cf1
rename class
staabm 9cba0cf
added config parameters
staabm 739cedf
fix test
staabm a21f6bb
more tests
staabm a0a0181
test version parameters
staabm 5c454b8
Update e2e-tests.yml
staabm fdcb1d2
prevent 'Comparison operation "<" between int<70205, 90000> and 70205…
staabm aad4e8b
downgrade composer/semver for brianium/paratest:4.0.0 compat
staabm 819de2f
incorporate feedback
staabm 7cb54fe
spaces to tabs
staabm 6ebf7ca
support more constants
staabm f0a6d44
Narrow `PHP_VERSION` in version_compare()
staabm e6307b2
another test
staabm 0c9f369
fix
staabm File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
/vendor/ | ||
composer.lock |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"require": { | ||
"php": "<=8.3" | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
includes: | ||
- ../../conf/bleedingEdge.neon |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?php | ||
|
||
\PHPStan\Testing\assertType('int<50207, 80300>', PHP_VERSION_ID); | ||
\PHPStan\Testing\assertType('int<5, 8>', PHP_MAJOR_VERSION); | ||
\PHPStan\Testing\assertType('int<0, max>', PHP_MINOR_VERSION); | ||
\PHPStan\Testing\assertType('int<0, max>', PHP_RELEASE_VERSION); | ||
|
||
\PHPStan\Testing\assertType('-1|0|1', version_compare(PHP_VERSION, '7.0.0')); | ||
\PHPStan\Testing\assertType('bool', version_compare(PHP_VERSION, '7.0.0', '<')); | ||
\PHPStan\Testing\assertType('bool', version_compare(PHP_VERSION, '7.0.0', '>')); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
/vendor/ | ||
composer.lock |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"require": { | ||
"php": ">=8.1, <=8.2.99" | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
includes: | ||
- ../../conf/bleedingEdge.neon |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?php | ||
|
||
\PHPStan\Testing\assertType('int<80099, 80299>', PHP_VERSION_ID); | ||
\PHPStan\Testing\assertType('8', PHP_MAJOR_VERSION); | ||
\PHPStan\Testing\assertType('int<0, 2>', PHP_MINOR_VERSION); | ||
\PHPStan\Testing\assertType('int<0, max>', PHP_RELEASE_VERSION); | ||
|
||
\PHPStan\Testing\assertType('1', version_compare(PHP_VERSION, '7.0.0')); | ||
\PHPStan\Testing\assertType('false', version_compare(PHP_VERSION, '7.0.0', '<')); | ||
\PHPStan\Testing\assertType('true', version_compare(PHP_VERSION, '7.0.0', '>')); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
/vendor/ | ||
composer.lock |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"require": { | ||
"php": ">= 8.1" | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
includes: | ||
- ../../conf/bleedingEdge.neon |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?php | ||
|
||
\PHPStan\Testing\assertType('int<80099, max>', PHP_VERSION_ID); | ||
\PHPStan\Testing\assertType('int<8, max>', PHP_MAJOR_VERSION); | ||
\PHPStan\Testing\assertType('int<0, max>', PHP_MINOR_VERSION); | ||
\PHPStan\Testing\assertType('int<0, max>', PHP_RELEASE_VERSION); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
/vendor/ | ||
composer.lock |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"require": { | ||
"php": "^8.1" | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?php | ||
|
||
// no bleeding edge enabled | ||
\PHPStan\Testing\assertType('int<50207, max>', PHP_VERSION_ID); | ||
\PHPStan\Testing\assertType('int<5, max>', PHP_MAJOR_VERSION); | ||
\PHPStan\Testing\assertType('int<0, max>', PHP_MINOR_VERSION); | ||
\PHPStan\Testing\assertType('int<0, max>', PHP_RELEASE_VERSION); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
/vendor/ | ||
composer.lock |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"require": { | ||
"php": "^8.1" | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
includes: | ||
- ../../conf/bleedingEdge.neon |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?php | ||
|
||
\PHPStan\Testing\assertType('int<80099, 90000>', PHP_VERSION_ID); | ||
\PHPStan\Testing\assertType('int<8, 9>', PHP_MAJOR_VERSION); | ||
\PHPStan\Testing\assertType('int<0, max>', PHP_MINOR_VERSION); | ||
\PHPStan\Testing\assertType('int<0, max>', PHP_RELEASE_VERSION); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
/vendor/ | ||
composer.lock |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"require": { | ||
"php": ">=8.0.2, <8.0.15" | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
includes: | ||
- ../../conf/bleedingEdge.neon |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?php | ||
|
||
// constraint from composer.json is overruled by phpstan.neon config | ||
\PHPStan\Testing\assertType('int<80001, 80015>', PHP_VERSION_ID); | ||
\PHPStan\Testing\assertType('8', PHP_MAJOR_VERSION); | ||
\PHPStan\Testing\assertType('0', PHP_MINOR_VERSION); | ||
\PHPStan\Testing\assertType('int<1, 15>', PHP_RELEASE_VERSION); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
/vendor/ | ||
composer.lock |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"require": { | ||
"php": "^8.0" | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
includes: | ||
- ../../conf/bleedingEdge.neon | ||
parameters: | ||
phpVersion: | ||
min: 80103 | ||
max: 80304 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?php | ||
|
||
// constraint from composer.json is overruled by phpstan.neon config | ||
\PHPStan\Testing\assertType('int<80103, 80304>', PHP_VERSION_ID); | ||
\PHPStan\Testing\assertType('8', PHP_MAJOR_VERSION); | ||
\PHPStan\Testing\assertType('int<1, 3>', PHP_MINOR_VERSION); | ||
\PHPStan\Testing\assertType('int<0, max>', PHP_RELEASE_VERSION); | ||
|
||
\PHPStan\Testing\assertType('1', version_compare(PHP_VERSION, '7.0.0')); | ||
\PHPStan\Testing\assertType('false', version_compare(PHP_VERSION, '7.0.0', '<')); | ||
\PHPStan\Testing\assertType('true', version_compare(PHP_VERSION, '7.0.0', '>')); |
Oops, something went wrong.
Oops, something went wrong.
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.
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.
AFAK
PHP_VERSION_ID
starts with the major/minor even if run on alpha releasePHP_MINOR_VERSION
should be narrowed ifPHP_MAJOR_VERSION
is one constant numberThere 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.
See #2968 (comment)
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 saw it. But I do not support it. The reason is composer already check this during runtime and if the check is really, really wanted, the user should ignore that error instead.