aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/src/command/search_command.rs
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-05-20 08:33:49 +0900
committernsfisis <nsfisis@gmail.com>2026-05-20 08:33:57 +0900
commitf31b101ce1e921a026ba234b1f0a83b0392bc118 (patch)
treeb7ac2aa84d71ebd162cc21aeab0240e7e0544988 /crates/shirabe/src/command/search_command.rs
parent5e31fa33c3b5cf726a57a063b8e7a070869250fe (diff)
downloadphp-shirabe-f31b101ce1e921a026ba234b1f0a83b0392bc118.tar.gz
php-shirabe-f31b101ce1e921a026ba234b1f0a83b0392bc118.tar.zst
php-shirabe-f31b101ce1e921a026ba234b1f0a83b0392bc118.zip
fix(compile): fix all remaining compile errors
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe/src/command/search_command.rs')
-rw-r--r--crates/shirabe/src/command/search_command.rs23
1 files changed, 16 insertions, 7 deletions
diff --git a/crates/shirabe/src/command/search_command.rs b/crates/shirabe/src/command/search_command.rs
index 2532f87..0b5cc21 100644
--- a/crates/shirabe/src/command/search_command.rs
+++ b/crates/shirabe/src/command/search_command.rs
@@ -47,7 +47,7 @@ impl SearchCommand {
input: &dyn InputInterface,
output: &dyn OutputInterface,
) -> Result<i64> {
- let platform_repo = PlatformRepository::new(vec![], IndexMap::new(), None, None)?;
+ let platform_repo = PlatformRepository::new4(vec![], IndexMap::new(), None, None)?;
let io = self.get_io();
let format = input
@@ -73,19 +73,26 @@ impl SearchCommand {
let composer = if let Some(c) = self.try_composer(None, None) {
c
} else {
- self.create_composer_instance(input, self.get_io(), vec![])?
+ // TODO(phase-b): clone_box to release self borrow held by get_io.
+ let io_box = self.get_io().clone_box();
+ self.create_composer_instance(input, io_box.as_ref(), None, false, None)?
};
- let local_repo = composer.get_repository_manager().get_local_repository();
- let installed_repo =
- CompositeRepository::new(vec![Box::new(local_repo), Box::new(platform_repo)]);
+ // TODO(phase-b): get_local_repository returns &dyn InstalledRepositoryInterface but we need Box<dyn RepositoryInterface>
+ let local_repo: Box<dyn RepositoryInterface> =
+ todo!("share local_repo as RepositoryInterface");
+ let installed_repo = CompositeRepository::new(vec![local_repo, Box::new(platform_repo)]);
let mut all_repos: Vec<Box<dyn RepositoryInterface>> = vec![Box::new(installed_repo)];
- all_repos.extend(composer.get_repository_manager().get_repositories());
+ // TODO(phase-b): get_repositories returns &Vec<Box<...>>; needs ownership reshape
+ for r in composer.get_repository_manager().get_repositories() {
+ all_repos.push(r.clone_box());
+ }
let repos = CompositeRepository::new(all_repos);
// TODO(plugin): dispatch CommandEvent for search command
let command_event = CommandEvent::new(PluginEvents::COMMAND, "search", input, output);
composer
.get_event_dispatcher()
+ .borrow_mut()
.dispatch(Some(command_event.get_name()), None);
let mut mode: i64 = repository_interface::SEARCH_FULLTEXT;
@@ -165,7 +172,9 @@ impl SearchCommand {
}
}
} else if format == "json" {
- io.write(&JsonFile::encode(&results, 448));
+ // TODO(phase-b): JsonFile::encode takes &PhpMixed; convert Vec<SearchResult> into PhpMixed
+ let _ = &results;
+ io.write(&JsonFile::encode(&PhpMixed::Null, 448));
}
Ok(0)