Prune empty sections in composer.json#1053
Merged
localheinz merged 1 commit intoergebnis:mainfrom Apr 10, 2025
Merged
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1053 +/- ##
============================================
- Coverage 97.94% 97.26% -0.69%
- Complexity 196 203 +7
============================================
Files 32 32
Lines 828 840 +12
============================================
+ Hits 811 817 +6
- Misses 17 23 +6 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
2f2c606 to
2a5e4d2
Compare
composer.json
1699024 to
f1747f3
Compare
f1747f3 to
a2b58fc
Compare
localheinz
approved these changes
Apr 10, 2025
Member
|
Thank you, @fredden! |
This file contains hidden or 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
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.
This pull request removes empty sections from
composer.jsonwhen they are defined as optional (or more specifically, not specified as required) according to the schema.I have hidden this feature behind an optional constructor property, so that other users of this package can decide if they also want to have empty-and-optional elements removed during normalisation.
The removal happens after normalisation so we can process nesting properly.
I chose to not remove empty elements which are not defined in the schema.
Related to composer/composer#7691