diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-05-15 00:52:14 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-05-15 19:51:17 +0900 |
| commit | 9bb267826d26fe595244c406dc90fc33a430d0e1 (patch) | |
| tree | 6f1b020fc2bedd7430a40254cbe5eb4fe92c0c1f /crates/shirabe/src/repository | |
| parent | 87e3ca50511ddce5de6241f8bb8770666ca88e31 (diff) | |
| download | php-shirabe-9bb267826d26fe595244c406dc90fc33a430d0e1.tar.gz php-shirabe-9bb267826d26fe595244c406dc90fc33a430d0e1.tar.zst php-shirabe-9bb267826d26fe595244c406dc90fc33a430d0e1.zip | |
feat(port): port VcsDriverInterface.php
Diffstat (limited to 'crates/shirabe/src/repository')
| -rw-r--r-- | crates/shirabe/src/repository/vcs/vcs_driver_interface.rs | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/crates/shirabe/src/repository/vcs/vcs_driver_interface.rs b/crates/shirabe/src/repository/vcs/vcs_driver_interface.rs index aad6d4c..a17acad 100644 --- a/crates/shirabe/src/repository/vcs/vcs_driver_interface.rs +++ b/crates/shirabe/src/repository/vcs/vcs_driver_interface.rs @@ -1 +1,37 @@ //! ref: composer/src/Composer/Repository/Vcs/VcsDriverInterface.php + +use chrono::{DateTime, Utc}; +use indexmap::IndexMap; +use shirabe_php_shim::PhpMixed; +use crate::config::Config; +use crate::io::io_interface::IOInterface; + +pub trait VcsDriverInterface { + fn initialize(&mut self) -> anyhow::Result<()>; + + fn get_composer_information(&self, identifier: &str) -> anyhow::Result<Option<IndexMap<String, PhpMixed>>>; + + fn get_file_content(&self, file: &str, identifier: &str) -> anyhow::Result<Option<String>>; + + fn get_change_date(&self, identifier: &str) -> anyhow::Result<Option<DateTime<Utc>>>; + + fn get_root_identifier(&self) -> anyhow::Result<String>; + + fn get_branches(&self) -> anyhow::Result<IndexMap<String, String>>; + + fn get_tags(&self) -> anyhow::Result<IndexMap<String, String>>; + + fn get_dist(&self, identifier: &str) -> anyhow::Result<Option<IndexMap<String, String>>>; + + fn get_source(&self, identifier: &str) -> anyhow::Result<IndexMap<String, String>>; + + fn get_url(&self) -> String; + + fn has_composer_file(&self, identifier: &str) -> anyhow::Result<bool>; + + fn cleanup(&mut self) -> anyhow::Result<()>; + + fn supports(io: &dyn IOInterface, config: &Config, url: &str, deep: bool) -> bool + where + Self: Sized; +} |
