aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/src/command/package_discovery_trait.rs
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-06-07 10:33:53 +0900
committernsfisis <nsfisis@gmail.com>2026-06-07 10:33:53 +0900
commit971824aa15334fd12d08ae0f441f6bf6079344c3 (patch)
treed59892042f478c65d980d96f62ef633644fd8fea /crates/shirabe/src/command/package_discovery_trait.rs
parent0d45c403c20ac8950f2877a21f9cd4f0ca9bf784 (diff)
downloadphp-shirabe-971824aa15334fd12d08ae0f441f6bf6079344c3.tar.gz
php-shirabe-971824aa15334fd12d08ae0f441f6bf6079344c3.tar.zst
php-shirabe-971824aa15334fd12d08ae0f441f6bf6079344c3.zip
feat(shirabe): resolve phase-b TODOs with shared ownership
Replace TODO(phase-b) placeholders (todo!() and commented-out code) with real implementations: - Share JsonFile via Rc<RefCell<JsonFile>> so JsonConfigSource and the owning command can hold the same instance (base_config_command, config_command, repository_command, require_command, create_project, remove_command, factory) - Change InstallerInterface methods (is_installed, download, prepare, cleanup, get_install_path) to &mut self so initialize_vendor_dir can run, propagated to all installer implementations - Pass io/config/filesystem/process by clone instead of moving or stubbing (auth_helper, svn_driver, curl_downloader, library_installer) - Make TransportException Clone and store it by value in VcsRepository - Clone operations in Transaction sort, root_aliases/temporary_constraints in RepositorySet::create_pool, and share CompletePackage via handle in PlatformRepository - Wire up set_option, set_requires/set_dev_requires, installation manager setters, BumpCommand::set_composer, and clean_backups/set_local_phar
Diffstat (limited to 'crates/shirabe/src/command/package_discovery_trait.rs')
-rw-r--r--crates/shirabe/src/command/package_discovery_trait.rs12
1 files changed, 7 insertions, 5 deletions
diff --git a/crates/shirabe/src/command/package_discovery_trait.rs b/crates/shirabe/src/command/package_discovery_trait.rs
index 9bd49c2..4162676 100644
--- a/crates/shirabe/src/command/package_discovery_trait.rs
+++ b/crates/shirabe/src/command/package_discovery_trait.rs
@@ -260,8 +260,11 @@ pub trait PackageDiscoveryTrait {
Some(s) => s.to_string(),
None => break,
};
- // TODO(phase-b): self.get_repos() (&mut self) conflicts with io borrow (&self)
- let mut matches: Vec<SearchResult> = todo!("self.get_repos().search()");
+ let mut matches: Vec<SearchResult> = self.get_repos().search(
+ package.clone(),
+ crate::repository::repository_interface::SEARCH_FULLTEXT,
+ None,
+ )?;
if count(&PhpMixed::List(
matches.iter().map(|_| Box::new(PhpMixed::Null)).collect(),
@@ -291,9 +294,8 @@ pub trait PackageDiscoveryTrait {
// no match, prompt which to pick
if !exact_match {
- // TODO(phase-b): self.get_repos() (&mut self) conflicts with io borrow (&self)
let providers: IndexMap<String, crate::repository::ProviderInfo> =
- todo!("self.get_repos().get_providers()");
+ self.get_repos().get_providers(package.clone())?;
if count(&PhpMixed::List(
providers.iter().map(|_| Box::new(PhpMixed::Null)).collect(),
)) > 0
@@ -449,7 +451,7 @@ pub trait PackageDiscoveryTrait {
let (_name, c): (String, String) = self
.find_best_version_and_name_for_package(
io.clone(),
- input,
+ input.clone(),
&package,
platform_repo,
preferred_stability,