aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/src/config/config_source_interface.rs
blob: f8676cc738c0e1462511d5bece48bcfa54cd81c9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
//! ref: composer/src/Composer/Config/ConfigSourceInterface.php

use shirabe_php_shim::PhpMixed;

pub trait ConfigSourceInterface: std::fmt::Debug {
    fn add_repository(&mut self, name: &str, config: PhpMixed, append: bool) -> anyhow::Result<()>;

    fn insert_repository(
        &mut self,
        name: &str,
        config: 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;
}