mirror of
https://github.com/composer/composer
synced 2025-05-11 01:22:54 +00:00
Sort vendor/composer/installed.json deterministically
Just like composer.lock, sort installed.json in order of the package names. This makes it easier to review diffs when this file is changed.
This commit is contained in:
parent
edece864e7
commit
2a38417653
1 changed files with 4 additions and 0 deletions
|
@ -83,6 +83,10 @@ class FilesystemRepository extends WritableArrayRepository
|
|||
$data[] = $dumper->dump($package);
|
||||
}
|
||||
|
||||
usort($data, function($a, $b) {
|
||||
return strcmp($a['name'], $b['name']);
|
||||
});
|
||||
|
||||
$this->file->write($data);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue