aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/src/repository/vcs/github_driver.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/repository/vcs/github_driver.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/repository/vcs/github_driver.rs')
-rw-r--r--crates/shirabe/src/repository/vcs/github_driver.rs34
1 files changed, 17 insertions, 17 deletions
diff --git a/crates/shirabe/src/repository/vcs/github_driver.rs b/crates/shirabe/src/repository/vcs/github_driver.rs
index 9dbb8513..56ff3853 100644
--- a/crates/shirabe/src/repository/vcs/github_driver.rs
+++ b/crates/shirabe/src/repository/vcs/github_driver.rs
@@ -24,24 +24,24 @@ use shirabe_php_shim::{
#[derive(Debug)]
pub struct GitHubDriver {
- pub(crate) inner: VcsDriverBase,
- pub(crate) owner: String,
- pub(crate) repository: String,
+ inner: VcsDriverBase,
+ owner: String,
+ repository: String,
/// @var array<int|string, string> Map of tag name to identifier
- pub(crate) tags: Option<IndexMap<String, String>>,
+ tags: Option<IndexMap<String, String>>,
/// @var array<int|string, string> Map of branch name to identifier
- pub(crate) branches: Option<IndexMap<String, String>>,
- pub(crate) root_identifier: String,
+ branches: Option<IndexMap<String, String>>,
+ root_identifier: String,
/// @var mixed[]
- pub(crate) repo_data: Option<IndexMap<String, PhpMixed>>,
- pub(crate) has_issues: bool,
- pub(crate) is_private: bool,
+ repo_data: Option<IndexMap<String, PhpMixed>>,
+ has_issues: bool,
+ is_private: bool,
is_archived: bool,
/// @var array<int, array{type: string, url: string}>|false|null
funding_info: Option<PhpMixed>,
allow_git_fallback: bool,
/// Git Driver
- pub(crate) git_driver: Option<GitDriver>,
+ git_driver: Option<GitDriver>,
}
impl GitHubDriver {
@@ -194,7 +194,7 @@ impl GitHubDriver {
)
}
- pub(crate) fn get_api_url(&self) -> String {
+ fn get_api_url(&self) -> String {
let api_url = if self.inner.origin_url == "github.com" {
"api.github.com".to_string()
} else {
@@ -995,7 +995,7 @@ impl GitHubDriver {
}
/// Generate an SSH URL
- pub(crate) fn generate_ssh_url(&self) -> String {
+ fn generate_ssh_url(&self) -> String {
if strpos(&self.inner.origin_url, ":").is_some() {
return format!(
"ssh://git@{}/{}/{}.git",
@@ -1009,7 +1009,7 @@ impl GitHubDriver {
)
}
- pub(crate) fn get_contents(
+ fn get_contents(
&mut self,
url: &str,
fetching_repo_data: bool,
@@ -1154,7 +1154,7 @@ impl GitHubDriver {
/// Fetch root identifier from GitHub
///
/// @throws TransportException
- pub(crate) fn fetch_root_identifier(&mut self) -> anyhow::Result<()> {
+ fn fetch_root_identifier(&mut self) -> anyhow::Result<()> {
if self.repo_data.is_some() {
return Ok(());
}
@@ -1225,7 +1225,7 @@ impl GitHubDriver {
/// @phpstan-impure
///
/// @throws \RuntimeException
- pub(crate) fn attempt_clone_fallback(
+ fn attempt_clone_fallback(
&mut self,
e: Option<std::sync::Arc<anyhow::Error>>,
) -> anyhow::Result<bool> {
@@ -1263,7 +1263,7 @@ impl GitHubDriver {
}
}
- pub(crate) fn setup_git_driver(&mut self, url: &str) -> anyhow::Result<()> {
+ fn setup_git_driver(&mut self, url: &str) -> anyhow::Result<()> {
if !self.allow_git_fallback {
return Err(
RuntimeException::new("Fallback to git driver disabled".to_string()).into(),
@@ -1283,7 +1283,7 @@ impl GitHubDriver {
Ok(())
}
- pub(crate) fn get_next_page(&self, response: &Response) -> Option<String> {
+ fn get_next_page(&self, response: &Response) -> Option<String> {
let header = response.get_header("link")?;
if header.is_empty() {
return None;