aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/src/config
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-05-14 23:40:25 +0900
committernsfisis <nsfisis@gmail.com>2026-05-14 23:40:25 +0900
commit785aa18c39f9629b7931e547ba9da6d080ac64b2 (patch)
treea8872d8276c9d5d99a39012307e031eea9773c53 /crates/shirabe/src/config
parentf98490f28bd784417ac3079599564726573c7702 (diff)
downloadphp-shirabe-785aa18c39f9629b7931e547ba9da6d080ac64b2.tar.gz
php-shirabe-785aa18c39f9629b7931e547ba9da6d080ac64b2.tar.zst
php-shirabe-785aa18c39f9629b7931e547ba9da6d080ac64b2.zip
feat(port): port ConfigSourceInterface.php
Diffstat (limited to 'crates/shirabe/src/config')
-rw-r--r--crates/shirabe/src/config/config_source_interface.rs27
1 files changed, 27 insertions, 0 deletions
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<IndexMap<String, PhpMixed>>, append: bool) -> anyhow::Result<()>;
+
+ fn insert_repository(&mut self, name: &str, config: Option<IndexMap<String, PhpMixed>>, 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;
+}