aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/mozart-core
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-05-09 14:44:26 +0900
committernsfisis <nsfisis@gmail.com>2026-05-09 14:44:38 +0900
commit0802fd44ed11283f15900d2993fc495acf1bed01 (patch)
treee0e072dbbf3a7cbaa5f2be22682f6070ec2b7ea1 /crates/mozart-core
parent75b15f58b778b4574e74c86c103b7e36baf4eeb3 (diff)
downloadphp-mozart-0802fd44ed11283f15900d2993fc495acf1bed01.tar.gz
php-mozart-0802fd44ed11283f15900d2993fc495acf1bed01.tar.zst
php-mozart-0802fd44ed11283f15900d2993fc495acf1bed01.zip
refactor(commands): consolidate get_platform_requirement_filter into shared module
Removes the per-command duplicate implementations of get_platform_requirement_filter from dump_autoload and reinstall, and lifts a single canonical version into commands.rs.
Diffstat (limited to 'crates/mozart-core')
-rw-r--r--crates/mozart-core/src/composer.rs2
-rw-r--r--crates/mozart-core/src/factory.rs10
2 files changed, 6 insertions, 6 deletions
diff --git a/crates/mozart-core/src/composer.rs b/crates/mozart-core/src/composer.rs
index c76f428..64c3c97 100644
--- a/crates/mozart-core/src/composer.rs
+++ b/crates/mozart-core/src/composer.rs
@@ -246,7 +246,7 @@ impl LocalRepository {
/// "at most one package of each name, with aliases unfolded". Mozart
/// does not yet model alias packages, so this is currently a straight
/// pass-through over the loaded packages.
- pub fn canonical_packages(&self) -> impl Iterator<Item = &LocalPackage> {
+ pub fn get_canonical_packages(&self) -> impl Iterator<Item = &LocalPackage> {
self.packages.iter()
}
diff --git a/crates/mozart-core/src/factory.rs b/crates/mozart-core/src/factory.rs
index 6602056..a7a690c 100644
--- a/crates/mozart-core/src/factory.rs
+++ b/crates/mozart-core/src/factory.rs
@@ -429,7 +429,7 @@ mod tests {
let pkg = composer
.repository_manager()
.local_repository()
- .canonical_packages()
+ .get_canonical_packages()
.next()
.unwrap();
@@ -457,7 +457,7 @@ mod tests {
let pkg = composer
.repository_manager()
.local_repository()
- .canonical_packages()
+ .get_canonical_packages()
.next()
.unwrap();
@@ -478,7 +478,7 @@ mod tests {
let count = composer
.repository_manager()
.local_repository()
- .canonical_packages()
+ .get_canonical_packages()
.count();
assert_eq!(count, 0);
}
@@ -499,7 +499,7 @@ mod tests {
let names: Vec<&str> = composer
.repository_manager()
.local_repository()
- .canonical_packages()
+ .get_canonical_packages()
.map(|p| p.pretty_name())
.collect();
assert_eq!(names, vec!["a/a", "b/b"]);
@@ -541,7 +541,7 @@ mod tests {
let pkg = composer
.repository_manager()
.local_repository()
- .canonical_packages()
+ .get_canonical_packages()
.next()
.unwrap();