File tree Expand file tree Collapse file tree 3 files changed +5
-15
lines changed Expand file tree Collapse file tree 3 files changed +5
-15
lines changed Original file line number Diff line number Diff line change 11name : Tests and linting
22
3- on : [push]
3+ on : [push, pull_request ]
44
55jobs :
66 build :
Original file line number Diff line number Diff line change 1515 "php" : " ^7.4 || ^8.0" ,
1616 "guzzlehttp/guzzle" : " ^6.0 || ^7.0" ,
1717 "doctrine/inflector" : " ^1.0 || ^2.0" ,
18- "ext-json" : " *"
18+ "ext-json" : " *" ,
19+ "composer/metadata-minifier" : " ^1.0"
1920 },
2021 "require-dev" : {
2122 "phpspec/phpspec" : " ^6.0 || ^7.0" ,
Original file line number Diff line number Diff line change 44
55namespace Packagist \Api \Result ;
66
7+ use Composer \MetadataMinifier \MetadataMinifier ;
78use InvalidArgumentException ;
89use Packagist \Api \Result \Package \Author ;
910use Packagist \Api \Result \Package \Dist ;
@@ -131,19 +132,6 @@ public function createPackageResults(array $package): Package
131132 $ version ['name ' ] ??= '' ;
132133 $ version ['type ' ] ??= '' ;
133134
134- if (isset ($ version ['conflict ' ]) && !is_array ($ version ['conflict ' ])) {
135- unset($ version ['conflict ' ]);
136- }
137- if (isset ($ version ['suggest ' ]) && !is_array ($ version ['suggest ' ])) {
138- unset($ version ['suggest ' ]);
139- }
140- if (isset ($ version ['replace ' ]) && !is_array ($ version ['replace ' ])) {
141- unset($ version ['replace ' ]);
142- }
143- if (isset ($ version ['provide ' ]) && !is_array ($ version ['provide ' ])) {
144- unset($ version ['provide ' ]);
145- }
146-
147135 if (isset ($ version ['authors ' ]) && $ version ['authors ' ]) {
148136 foreach ($ version ['authors ' ] as $ key => $ author ) {
149137 // Cast some potentially null properties to empty strings
@@ -198,6 +186,7 @@ public function createComposer2PackagesResults(array $packages): array
198186 $ created = [];
199187
200188 foreach ($ packages as $ name => $ package ) {
189+ $ package = MetadataMinifier::expand ($ package );
201190 // Create an empty package, only contains versions
202191 $ createdPackage = array (
203192 'versions ' => [],
You can’t perform that action at this time.
0 commit comments