From 785aa18c39f9629b7931e547ba9da6d080ac64b2 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Thu, 14 May 2026 23:40:25 +0900 Subject: feat(port): port ConfigSourceInterface.php --- .../shirabe/src/config/config_source_interface.rs | 27 ++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'crates/shirabe/src/config/config_source_interface.rs') diff --git a/crates/shirabe/src/config/config_source_interface.rs b/crates/shirabe/src/config/config_source_interface.rs index 89cde76..9f3321c 100644 --- a/crates/shirabe/src/config/config_source_interface.rs +++ b/crates/shirabe/src/config/config_source_interface.rs @@ -1 +1,28 @@ //! ref: composer/src/Composer/Config/ConfigSourceInterface.php + +use indexmap::IndexMap; +use shirabe_php_shim::PhpMixed; + +pub trait ConfigSourceInterface { + fn add_repository(&mut self, name: &str, config: Option>, append: bool) -> anyhow::Result<()>; + + fn insert_repository(&mut self, name: &str, config: Option>, reference_name: &str, offset: i64) -> anyhow::Result<()>; + + fn set_repository_url(&mut self, name: &str, url: &str) -> anyhow::Result<()>; + + fn remove_repository(&mut self, name: &str) -> anyhow::Result<()>; + + fn add_config_setting(&mut self, name: &str, value: PhpMixed) -> anyhow::Result<()>; + + fn remove_config_setting(&mut self, name: &str) -> anyhow::Result<()>; + + fn add_property(&mut self, name: &str, value: PhpMixed) -> anyhow::Result<()>; + + fn remove_property(&mut self, name: &str) -> anyhow::Result<()>; + + fn add_link(&mut self, r#type: &str, name: &str, value: &str) -> anyhow::Result<()>; + + fn remove_link(&mut self, r#type: &str, name: &str) -> anyhow::Result<()>; + + fn get_name(&self) -> String; +} -- cgit v1.3.1