Skip to content

Fix repositories array becoming a JSON object after path-type dedup#115

Merged
kayw-geek merged 1 commit into
symplify:mainfrom
kayw-geek:fix/repository-path-dedup-reindex
Apr 22, 2026
Merged

Fix repositories array becoming a JSON object after path-type dedup#115
kayw-geek merged 1 commit into
symplify:mainfrom
kayw-geek:fix/repository-path-dedup-reindex

Conversation

@kayw-geek

Copy link
Copy Markdown
Collaborator

Fixes #113.

RepositoryPathComposerJsonDecorator::processRemoveDuplicates() used unset() without reindexing, leaving non-sequential integer keys in the repositories array. Nette\Utils\Json::encode() then serializes that as a JSON object instead of an array — valid Composer-wise, but a noisy diff and breaks tooling that assumes a list.

Fix:

  • Wrap the final assignment in array_values(...) to reindex.
  • Add continue; after unset() so a discarded URL isn't re-pushed onto $paths.
  • Update the existing decorator test fixture to assert sequential keys (was asserting the buggy 0, 1, 3).

@kayw-geek kayw-geek merged commit a7255fb into symplify:main Apr 22, 2026
38 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

merge emits repositories as a JSON object instead of an array after path-type deduplication

1 participant