From 318ea948f5932dfa7942081a269d62fd7161a9bf Mon Sep 17 00:00:00 2001 From: nsfisis Date: Mon, 8 Jun 2026 01:54:56 +0900 Subject: feat(phase-c): resolve reflection/downcast phase-b TODOs Resolve category F phase-b TODOs (class-string, instanceof, get_class, method_exists, __FILE__, Reflection API, downcast). - VcsRepository: dispatch drivers through a VcsDriverKind enum (instantiate/supports/php_class_name) and add constructors to the concrete VCS drivers - repository downcasts via RepositoryInterfaceHandle::downcast_rc and as_any (init/show commands, vcs ValidatingArrayLoader) - BaseCommand::is_self_update_command override replaces an instanceof - Factory::create narrows PartialComposer to ComposerHandle via as_full - InstalledVersions gains set_self_dir/set_installed_is_local_dir, replacing Reflection-based static property mutation - ClassLoader::as_array_iter ports the PHP (array) cast - drop the unnecessary __FILE__ phar branch in self-update application get_class(command) reclassified TODO(plugin); buffer_io StreamableInputInterface downcast and the ValidatingArrayLoader trait redesign left as tracked TODOs. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../src/repository/vcs/git_bitbucket_driver.rs | 26 ++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'crates/shirabe/src/repository/vcs/git_bitbucket_driver.rs') diff --git a/crates/shirabe/src/repository/vcs/git_bitbucket_driver.rs b/crates/shirabe/src/repository/vcs/git_bitbucket_driver.rs index 2a8d374..3f0be13 100644 --- a/crates/shirabe/src/repository/vcs/git_bitbucket_driver.rs +++ b/crates/shirabe/src/repository/vcs/git_bitbucket_driver.rs @@ -58,6 +58,32 @@ pub struct GitBitbucketDriver { } impl GitBitbucketDriver { + pub fn new( + repo_config: IndexMap, + io: std::rc::Rc>, + config: std::rc::Rc>, + http_downloader: std::rc::Rc>, + process: std::rc::Rc>, + ) -> Self { + Self { + inner: VcsDriverBase::new(repo_config, io, config, http_downloader, process), + owner: String::new(), + repository: String::new(), + has_issues: false, + root_identifier: None, + tags: None, + branches: None, + branches_url: String::new(), + tags_url: String::new(), + home_url: String::new(), + website: String::new(), + clone_https_url: String::new(), + repo_data: IndexMap::new(), + fallback_driver: None, + vcs_type: None, + } + } + /// @inheritDoc pub fn initialize(&mut self) -> Result<()> { let mut m: indexmap::IndexMap = indexmap::IndexMap::new(); -- cgit v1.3.1