aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/src/repository/vcs/github_driver.rs
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-06-08 01:54:56 +0900
committernsfisis <nsfisis@gmail.com>2026-06-08 01:54:56 +0900
commit318ea948f5932dfa7942081a269d62fd7161a9bf (patch)
tree0fff2fe818f87a20dea89a51901f9e16071f2f53 /crates/shirabe/src/repository/vcs/github_driver.rs
parentf232d7f9d2936ef84bd904cacd21c12cb7012b34 (diff)
downloadphp-shirabe-318ea948f5932dfa7942081a269d62fd7161a9bf.tar.gz
php-shirabe-318ea948f5932dfa7942081a269d62fd7161a9bf.tar.zst
php-shirabe-318ea948f5932dfa7942081a269d62fd7161a9bf.zip
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) <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe/src/repository/vcs/github_driver.rs')
-rw-r--r--crates/shirabe/src/repository/vcs/github_driver.rs24
1 files changed, 24 insertions, 0 deletions
diff --git a/crates/shirabe/src/repository/vcs/github_driver.rs b/crates/shirabe/src/repository/vcs/github_driver.rs
index b3d5e05..6fc50ee 100644
--- a/crates/shirabe/src/repository/vcs/github_driver.rs
+++ b/crates/shirabe/src/repository/vcs/github_driver.rs
@@ -47,6 +47,30 @@ pub struct GitHubDriver {
}
impl GitHubDriver {
+ pub fn new(
+ repo_config: IndexMap<String, shirabe_php_shim::PhpMixed>,
+ io: std::rc::Rc<std::cell::RefCell<dyn IOInterface>>,
+ config: std::rc::Rc<std::cell::RefCell<Config>>,
+ http_downloader: std::rc::Rc<std::cell::RefCell<crate::util::HttpDownloader>>,
+ process: std::rc::Rc<std::cell::RefCell<crate::util::ProcessExecutor>>,
+ ) -> Self {
+ Self {
+ inner: VcsDriverBase::new(repo_config, io, config, http_downloader, process),
+ owner: String::new(),
+ repository: String::new(),
+ tags: None,
+ branches: None,
+ root_identifier: String::new(),
+ repo_data: None,
+ has_issues: false,
+ is_private: false,
+ is_archived: false,
+ funding_info: None,
+ allow_git_fallback: true,
+ git_driver: None,
+ }
+ }
+
pub fn initialize(&mut self) -> Result<()> {
let mut match_: IndexMap<CaptureKey, String> = IndexMap::new();
if !Preg::is_match_strict_groups3(