Skip to content

Commit

Permalink
Fix: Do not attempt to sort item when it diables packagist
Browse files Browse the repository at this point in the history
  • Loading branch information
localheinz committed Dec 14, 2023
1 parent 87634f5 commit 217eab0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

For a full diff see [`4.4.0...main`][4.4.0...main].

### Fixed

- Stopped sorting an item in `repositories` when it disables packagist ([#1039]), by [@localheinz]

## [`4.4.0`][4.4.0]

For a full diff see [`4.3.0...4.4.0`][4.3.0...4.4.0].
Expand Down Expand Up @@ -664,6 +668,7 @@ For a full diff see [`5d8b3e2...0.1.0`][5d8b3e2...0.1.0].
[#992]: https://github.com/ergebnis/json-normalizer/pull/992
[#1001]: https://github.com/ergebnis/json-normalizer/pull/1001
[#1027]: https://github.com/ergebnis/json-normalizer/pull/1027
[#1039]: https://github.com/ergebnis/json-normalizer/pull/1039

[@alexis-saransig-lullabot]: https://github.com/alexis-saransig-lullabot
[@BackEndTea]: https://github.com/BackEndTea
Expand Down
9 changes: 8 additions & 1 deletion src/Vendor/Composer/RepositoriesHashNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,14 @@ public function normalize(Json $json): Json
return $json;
}

foreach ($repositories as &$repository) {
foreach ($repositories as $key => &$repository) {
/**
* @see https://getcomposer.org/doc/05-repositories.md#disabling-packagist-org
*/
if ('packagist' === $key) {
continue;
}

$repository = (array) $repository;

foreach (self::PROPERTIES_WITH_WILDCARDS as $property) {
Expand Down

0 comments on commit 217eab0

Please sign in to comment.