Closed SOHELAHMED7 closed 5 months ago
From what I know about composer version constraints, the ^3.0
constraint is equivalant to the following: >=3.0.0 <4.0.0
. Your additions will not allow for any more versions to be used.
I disagree.
For ^3.0
=> >=3.0.0 < 3.1
For ^1.2.3
=> >=1.2.3 < 1.2.4
Have you read the link I sent? It clearly states otherwise.
I just ran the VersionParser
from composer/semver
and this it the output for ^3.0
:
[
"lower" => Composer\Semver\Constraint\Bound {#4416
-version: "3.0.0.0-dev",
-isInclusive: true,
},
"upper" => Composer\Semver\Constraint\Bound {#4410
-version: "4.0.0.0-dev",
-isInclusive: false,
},
]
and this is the output for ^3.0.0
:
[
"lower" => Composer\Semver\Constraint\Bound {#4416
-version: "3.0.0.0-dev",
-isInclusive: true,
},
"upper" => Composer\Semver\Constraint\Bound {#4410
-version: "4.0.0.0-dev",
-isInclusive: false,
},
]
Snippet I used:
use Composer\Semver\VersionParser;
$version = (new VersionParser())->parseConstraints("^3.0");
[
"lower" => $version->getLowerBound(),
"upper" => $version->getUpperBound()
];
So, like I said, they are functionally the same. The ^3.0
constraint in our composer.json
allows for all versions that match the constraint >=3.0.0 <4.0.0
.
The examples you gave are incorrect, as ^3.0
matches the following versions:
[
"lower" => Composer\Semver\Constraint\Bound {#4416
-version: "3.0.0.0-dev",
-isInclusive: true,
},
"upper" => Composer\Semver\Constraint\Bound {#4410
-version: "4.0.0.0-dev",
-isInclusive: false,
},
]
and ^1.2.3
matches:
[
"lower" => Composer\Semver\Constraint\Bound {#4416
-version: "1.2.3.0-dev",
-isInclusive: true,
},
"upper" => Composer\Semver\Constraint\Bound {#4410
-version: "2.0.0.0-dev",
-isInclusive: false,
},
]
And when running the version string we have in our composer.json
, you can see that Faker matches everything between >=2.2 <4.0
.
``` Composer\Semver\Constraint\MultiConstraint {#4401 #constraints: [ Composer\Semver\Constraint\Constraint {#4407 #operator: 4, #version: "2.2.0.0-dev", #prettyString: null, #lowerBound: null, #upperBound: null, }, Composer\Semver\Constraint\Constraint {#4403 #operator: 1, #version: "4.0.0.0-dev", #prettyString: null, #lowerBound: null, #upperBound: null, }, ], #prettyString: "^2.2 || ^3.0", #string: null, #conjunctive: true, #lowerBound: null, #upperBound: null, } ```
For ^3.0 => >=3.0.0 < 3.1
This is incorrect, that's not what that does.
What is the reason for this PR?
Support newer version of symfony deprecation-contracts
When trying to install lib https://github.com/web-auth/webauthn-lib v4.7, I get error:
I also user FakerPHP/Faker in same project.
Author's checklist
Summary of changes
Support newer version of symfony deprecation-contracts
Review checklist
CHANGELOG.md