@@ -209,52 +209,36 @@ private function selectPackages(Composer $composer, OutputInterface $output, $ve
209
209
$ links [] = new Link ('__root__ ' , $ name , new MultiConstraint (array ()), 'requires ' , '* ' );
210
210
}
211
211
} else {
212
+ $ packages = array ();
212
213
if ($ filterForPackages ) {
213
- // collect all the packages based on the given $packagesFilter
214
- $ packages = array ();
215
- foreach ($ packagesFilter as $ filter ) {
214
+ // apply package filter if defined
215
+ foreach ($ packagesFilter as $ filter ) {
216
216
$ packages += $ repo ->findPackages ($ filter );
217
217
}
218
+ } else {
219
+ // process other repos directly
220
+ $ packages = $ repo ->getPackages ();
221
+ }
218
222
219
- foreach ($ packages as $ package ) {
220
- // skip aliases
221
- if ($ package instanceof AliasPackage) {
222
- continue ;
223
- }
223
+ foreach ($ packages as $ package ) {
224
+ // skip aliases
225
+ if ($ package instanceof AliasPackage) {
226
+ continue ;
227
+ }
224
228
225
- if ($ package ->getStability () > BasePackage::$ stabilities [$ minimumStability ]) {
226
- continue ;
227
- }
229
+ if ($ package ->getStability () > BasePackage::$ stabilities [$ minimumStability ]) {
230
+ continue ;
231
+ }
228
232
233
+ // add matching package if not yet selected
234
+ if (!isset ($ selected [$ package ->getName ()])) {
229
235
if ($ verbose ) {
230
- $ output ->writeln ('Selected ' .$ package ->getPrettyName ().' ( ' .$ package ->getPrettyVersion ().') based on the given filter options ' );
236
+ $ output ->writeln ('Selected ' .$ package ->getPrettyName ().' ( ' .$ package ->getPrettyVersion ().') ' );
231
237
}
232
238
233
239
$ selected [$ package ->getUniqueName ()] = $ package ;
234
240
}
235
241
}
236
- else {
237
- // process other repos directly
238
- foreach ($ repo ->getPackages () as $ package ) {
239
- // skip aliases
240
- if ($ package instanceof AliasPackage) {
241
- continue ;
242
- }
243
-
244
- if ($ package ->getStability () > BasePackage::$ stabilities [$ minimumStability ]) {
245
- continue ;
246
- }
247
-
248
- // add matching package if not yet selected
249
- if (!isset ($ selected [$ package ->getName ()])) {
250
- if ($ verbose ) {
251
- $ output ->writeln ('Selected ' .$ package ->getPrettyName ().' ( ' .$ package ->getPrettyVersion ().') ' );
252
- }
253
-
254
- $ selected [$ package ->getUniqueName ()] = $ package ;
255
- }
256
- }
257
- }
258
242
}
259
243
}
260
244
} else {
0 commit comments