Closed IonBazan closed 3 years ago
Merging #6 (b44fcd2) into master (4fcbe58) will not change coverage. The diff coverage is
100.00%
.
@@ Coverage Diff @@
## master #6 +/- ##
===========================================
Coverage 100.00% 100.00%
- Complexity 141 162 +21
===========================================
Files 16 19 +3
Lines 386 430 +44
===========================================
+ Hits 386 430 +44
Impacted Files | Coverage Δ | |
---|---|---|
src/Composer/Plugin.php | 100.00% <ø> (ø) |
|
src/Command/DiffCommand.php | 100.00% <100.00%> (ø) |
|
src/Diff/DiffEntries.php | 100.00% <100.00%> (ø) |
|
src/Diff/DiffEntry.php | 100.00% <100.00%> (ø) |
|
src/Diff/VersionComparator.php | 100.00% <100.00%> (ø) |
|
src/Formatter/AbstractFormatter.php | 100.00% <100.00%> (ø) |
|
src/Formatter/JsonFormatter.php | 100.00% <100.00%> (ø) |
|
src/Formatter/MarkdownListFormatter.php | 100.00% <100.00%> (ø) |
|
src/Formatter/MarkdownTableFormatter.php | 100.00% <100.00%> (ø) |
|
src/PackageDiff.php | 100.00% <100.00%> (ø) |
|
... and 3 more |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update 4fcbe58...b44fcd2. Read the comment docs.
@trakos Please check if this solves your issue. Comparing these dev-
parts is quite tricky so let me know if it's returning an expected result. Please check the test cases for more info.
@IonBazan thanks a lot, yes it does :) I use composer 2, and it shows Changed
as expected for dev-
versions.
I've also checked the test cases I mentioned in the issue and it shows Changed
for all of them :)
Good to hear! I am still thinking about implementing custom version comparison logic instead of using VersionParser and Semver as they produce slightly different results between different Composer versions to make it more consistent. The thing is that there is tons of logic behind it so I will most probably leave it as is. That's because the operation name is not that important as showing correct base and target versions.
This PR introduces new operation type:
Changed
which represents an operation where at least one of the components is referencing a branch/commit or a version constraint (for platform dependencies).Among with the refactoring, there are following breaking changes:
PackageDiff::getPackageDiff()
now returnsDiffEntries
instead ofarray
DiffEntries
insteadarray
toodev-
version changes are treated asChanged
instead ofUpgraded
which slightly differs from Composer output (which uses more sophisticated method to decide whether it's upgrade or downgrade - for example, anydev-master -> dev-branch
will be treated as downgrade)