Skip to content

Commit

Permalink
Merge pull request #780 from ergebnis/fix/extra-patches
Browse files Browse the repository at this point in the history
Fix: Adjust `ComposerJsonNormalizer` to stop sorting direct children of `extra.patches`
  • Loading branch information
localheinz committed Dec 12, 2022
2 parents 284d0e3 + ef84204 commit 5c7e6a2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Expand Up @@ -20,6 +20,7 @@ For a full diff see [`3.0.0...main`][3.0.0...main].
- Adjusted `Vendor\Composer\ComposerJsonNormalizer` to stop sorting `extra.installer-paths` ([#777]), by [@localheinz]
- Adjusted `Vendor\Composer\ComposerJsonNormalizer` to stop sorting `config.allow-plugins` ([#778]), by [@localheinz]
- Adjusted `Vendor\Composer\ComposerJsonNormalizer` to stop sorting `config.preferred-install` ([#779]), by [@localheinz]
- Adjusted `Vendor\Composer\ComposerJsonNormalizer` to stop sorting children of `extra.patches` ([#780]), by [@localheinz]

### Removed

Expand Down Expand Up @@ -535,6 +536,7 @@ For a full diff see [`5d8b3e2...0.1.0`][5d8b3e2...0.1.0].
[#777]: https://github.com/ergebnis/json-normalizer/pull/777
[#778]: https://github.com/ergebnis/json-normalizer/pull/778
[#779]: https://github.com/ergebnis/json-normalizer/pull/779
[#780]: https://github.com/ergebnis/json-normalizer/pull/780

[@BackEndTea]: https://github.com/BackEndTea
[@dependabot]: https://github.com/dependabot
Expand Down
3 changes: 3 additions & 0 deletions src/Vendor/Composer/ComposerJsonNormalizer.php
Expand Up @@ -34,6 +34,9 @@ public function __construct(string $schemaUri)
Pointer\Specification::equals(Pointer\JsonPointer::fromJsonString('/config/allow-plugins')),
Pointer\Specification::equals(Pointer\JsonPointer::fromJsonString('/config/preferred-install')),
Pointer\Specification::equals(Pointer\JsonPointer::fromJsonString('/extra/installer-paths')),
Pointer\Specification::closure(static function (Pointer\JsonPointer $jsonPointer): bool {
return 1 === \preg_match('{^\/extra\/patches\/([^/])+$}', $jsonPointer->toJsonString());
}),
Pointer\Specification::equals(Pointer\JsonPointer::fromJsonString('/scripts/auto-scripts')),
),
),
Expand Down
Expand Up @@ -21,8 +21,8 @@
"baz": "https://www.drupal.org/files/issues/2019-01-01/baz.patch"
},
"drupal/foo": {
"baz": "https://www.drupal.org/files/issues/2019-01-01/baz.patch",
"foo": "https://www.drupal.org/files/issues/2020-12-13/foo.patch"
"foo": "https://www.drupal.org/files/issues/2020-12-13/foo.patch",
"baz": "https://www.drupal.org/files/issues/2019-01-01/baz.patch"
}
}
}
Expand Down

0 comments on commit 5c7e6a2

Please sign in to comment.