Skip to content

Commit

Permalink
Fix: Do not attempt to sort item when it disables packagist
Browse files Browse the repository at this point in the history
  • Loading branch information
localheinz committed Dec 14, 2023
1 parent 87634f5 commit 574aded
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
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
5 changes: 0 additions & 5 deletions psalm-baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,6 @@
<code>$value</code>
</MixedAssignment>
</file>
<file src="src/Vendor/Composer/RepositoriesHashNormalizer.php">
<MixedAssignment>
<code>$repository</code>
</MixedAssignment>
</file>
<file src="src/Vendor/Composer/VersionConstraintNormalizer.php">
<MixedAssignment>
<code>$value</code>
Expand Down
7 changes: 7 additions & 0 deletions src/Vendor/Composer/RepositoriesHashNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,13 @@ public function normalize(Json $json): Json
}

foreach ($repositories as &$repository) {
/**
* @see https://getcomposer.org/doc/05-repositories.md#disabling-packagist-org
*/
if (!\is_array($repository) && !\is_object($repository)) {
continue;
}

$repository = (array) $repository;

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

0 comments on commit 574aded

Please sign in to comment.