aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/src/util/svn.rs
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-08-16 00:59:54 +0900
committernsfisis <nsfisis@gmail.com>2026-08-16 01:03:45 +0900
commit3a388b98a9aa6a14b1c7f7dc909c109cf9837800 (patch)
tree593e342313c6e6bd3ec2943a1690b8798e0a83ae /crates/shirabe/src/util/svn.rs
parentaad468e8b75ffc3e87ea6dfa22c53a8299fc08da (diff)
downloadphp-shirabe-3a388b98a9aa6a14b1c7f7dc909c109cf9837800.tar.gz
php-shirabe-3a388b98a9aa6a14b1c7f7dc909c109cf9837800.tar.zst
php-shirabe-3a388b98a9aa6a14b1c7f7dc909c109cf9837800.zip
refactor: narrow pub(crate) items to private
Porting mapped every PHP `protected` member onto `pub(crate)`, which is wider than nearly all of them need. Each item demoted here is reached only from the module that defines it, so the crate-wide visibility conveyed nothing. Every `pub(crate)` that survives has at least one reader in another module of the same crate. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe/src/util/svn.rs')
-rw-r--r--crates/shirabe/src/util/svn.rs35
1 files changed, 15 insertions, 20 deletions
diff --git a/crates/shirabe/src/util/svn.rs b/crates/shirabe/src/util/svn.rs
index 395f176f..bde2583d 100644
--- a/crates/shirabe/src/util/svn.rs
+++ b/crates/shirabe/src/util/svn.rs
@@ -23,21 +23,21 @@ pub struct SvnCredentials {
#[derive(Debug)]
pub struct Svn {
/// @var ?array{username: string, password: string}
- pub(crate) credentials: Option<SvnCredentials>,
+ credentials: Option<SvnCredentials>,
/// @var bool
- pub(crate) has_auth: Option<bool>,
+ has_auth: Option<bool>,
/// @var IOInterface
- pub(crate) io: std::rc::Rc<std::cell::RefCell<dyn IOInterface>>,
+ io: std::rc::Rc<std::cell::RefCell<dyn IOInterface>>,
/// @var string
- pub(crate) url: String,
+ url: String,
/// @var bool
- pub(crate) cache_credentials: bool,
+ cache_credentials: bool,
/// @var ProcessExecutor
- pub(crate) process: std::rc::Rc<std::cell::RefCell<ProcessExecutor>>,
+ process: std::rc::Rc<std::cell::RefCell<ProcessExecutor>>,
/// @var int
- pub(crate) qty_auth_tries: i64,
+ qty_auth_tries: i64,
/// @var Config
- pub(crate) config: std::rc::Rc<std::cell::RefCell<Config>>,
+ config: std::rc::Rc<std::cell::RefCell<Config>>,
}
/// @var string|null
@@ -202,7 +202,7 @@ impl Svn {
/// Repositories requests credentials, let's put them in.
///
/// @throws \RuntimeException
- pub(crate) fn do_auth_dance(&mut self) -> anyhow::Result<&mut Self> {
+ fn do_auth_dance(&mut self) -> anyhow::Result<&mut Self> {
// cannot ask for credentials in non interactive mode
if !self.io.is_interactive() {
return Err(RuntimeException::new(
@@ -247,12 +247,7 @@ impl Svn {
/// @param non-empty-list<string> $cmd Usually 'svn ls' or something like that.
/// @param string $url Repo URL.
/// @param string $path Target for a checkout
- pub(crate) fn get_command(
- &mut self,
- mut cmd: Vec<String>,
- url: &str,
- path: Option<&str>,
- ) -> Vec<String> {
+ fn get_command(&mut self, mut cmd: Vec<String>, url: &str, path: Option<&str>) -> Vec<String> {
cmd.push("--non-interactive".to_string());
cmd.extend(self.get_credential_args());
cmd.push("--".to_string());
@@ -268,7 +263,7 @@ impl Svn {
/// Return the credential string for the svn command.
///
/// Adds --no-auth-cache when credentials are present.
- pub(crate) fn get_credential_args(&mut self) -> Vec<String> {
+ fn get_credential_args(&mut self) -> Vec<String> {
if !self.has_auth() {
return vec![];
}
@@ -299,7 +294,7 @@ impl Svn {
/// Get the password for the svn command. Can be empty.
///
/// @throws \LogicException
- pub(crate) fn get_password(&self) -> anyhow::Result<String> {
+ fn get_password(&self) -> anyhow::Result<String> {
if self.credentials.is_none() {
return Err(LogicException::new("No svn auth detected.".to_string()).into());
}
@@ -310,7 +305,7 @@ impl Svn {
/// Get the username for the svn command.
///
/// @throws \LogicException
- pub(crate) fn get_username(&self) -> anyhow::Result<String> {
+ fn get_username(&self) -> anyhow::Result<String> {
if self.credentials.is_none() {
return Err(LogicException::new("No svn auth detected.".to_string()).into());
}
@@ -319,7 +314,7 @@ impl Svn {
}
/// Detect Svn Auth.
- pub(crate) fn has_auth(&mut self) -> bool {
+ fn has_auth(&mut self) -> bool {
if let Some(has_auth) = self.has_auth {
return has_auth;
}
@@ -332,7 +327,7 @@ impl Svn {
}
/// Return the no-auth-cache switch.
- pub(crate) fn get_auth_cache_args(&self) -> Vec<String> {
+ fn get_auth_cache_args(&self) -> Vec<String> {
if self.cache_credentials {
vec![]
} else {