diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-08-16 00:59:54 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-08-16 01:03:45 +0900 |
| commit | 3a388b98a9aa6a14b1c7f7dc909c109cf9837800 (patch) | |
| tree | 593e342313c6e6bd3ec2943a1690b8798e0a83ae /crates/shirabe/src/repository | |
| parent | aad468e8b75ffc3e87ea6dfa22c53a8299fc08da (diff) | |
| download | php-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')
16 files changed, 118 insertions, 121 deletions
diff --git a/crates/shirabe/src/repository/array_repository.rs b/crates/shirabe/src/repository/array_repository.rs index e5ed607d..b28cccdc 100644 --- a/crates/shirabe/src/repository/array_repository.rs +++ b/crates/shirabe/src/repository/array_repository.rs @@ -79,7 +79,7 @@ impl ArrayRepository { Ok(None) } - pub(crate) fn find_packages_internal( + fn find_packages_internal( &self, name: &str, constraint: Option<FindPackageConstraint>, @@ -157,7 +157,7 @@ impl ArrayRepository { Ok(()) } - pub(crate) fn create_alias_package( + fn create_alias_package( &self, package: BasePackageHandle, alias: String, diff --git a/crates/shirabe/src/repository/artifact_repository.rs b/crates/shirabe/src/repository/artifact_repository.rs index 75ad134b..c225e84d 100644 --- a/crates/shirabe/src/repository/artifact_repository.rs +++ b/crates/shirabe/src/repository/artifact_repository.rs @@ -26,9 +26,9 @@ use std::path::Path; pub struct ArtifactRepository { inner: ArrayRepository, - pub(crate) loader: Box<dyn LoaderInterface>, - pub(crate) lookup: String, - pub(crate) repo_config: IndexMap<String, PhpMixed>, + loader: Box<dyn LoaderInterface>, + lookup: String, + repo_config: IndexMap<String, PhpMixed>, io: std::rc::Rc<std::cell::RefCell<dyn IOInterface>>, } diff --git a/crates/shirabe/src/repository/composer_repository.rs b/crates/shirabe/src/repository/composer_repository.rs index 33944c8f..03439a7b 100644 --- a/crates/shirabe/src/repository/composer_repository.rs +++ b/crates/shirabe/src/repository/composer_repository.rs @@ -94,19 +94,19 @@ pub struct ComposerRepository { io: std::rc::Rc<std::cell::RefCell<dyn IOInterface>>, http_downloader: std::rc::Rc<std::cell::RefCell<HttpDownloader>>, r#loop: std::rc::Rc<std::cell::RefCell<Loop>>, - pub(crate) cache: std::cell::RefCell<Cache>, - pub(crate) notify_url: Option<String>, - pub(crate) search_url: Option<String>, - pub(crate) providers_api_url: Option<String>, - pub(crate) has_providers: bool, - pub(crate) providers_url: Option<String>, - pub(crate) list_url: Option<String>, - pub(crate) has_available_package_list: bool, - pub(crate) available_packages: Option<IndexMap<String, String>>, - pub(crate) available_package_patterns: Option<Vec<String>>, - pub(crate) lazy_providers_url: Option<String>, - pub(crate) provider_listing: Option<IndexMap<String, ProviderListingEntry>>, - pub(crate) loader: ArrayLoader, + cache: std::cell::RefCell<Cache>, + notify_url: Option<String>, + search_url: Option<String>, + providers_api_url: Option<String>, + has_providers: bool, + providers_url: Option<String>, + list_url: Option<String>, + has_available_package_list: bool, + available_packages: Option<IndexMap<String, String>>, + available_package_patterns: Option<Vec<String>>, + lazy_providers_url: Option<String>, + provider_listing: Option<IndexMap<String, ProviderListingEntry>>, + loader: ArrayLoader, allow_ssl_downgrade: bool, event_dispatcher: Option<std::rc::Rc<std::cell::RefCell<EventDispatcher>>>, source_mirrors: Option<IndexMap<String, Vec<SourceMirror>>>, @@ -3324,7 +3324,7 @@ impl ComposerRepository { /// Checks if the package name is present in this lazy providers repo /// /// @return true if the package name is present in availablePackages or matched by availablePackagePatterns - pub(crate) fn lazy_providers_repo_contains(&self, name: &str) -> anyhow::Result<bool> { + fn lazy_providers_repo_contains(&self, name: &str) -> anyhow::Result<bool> { if !self.has_available_package_list { return Err(LogicException::new("lazyProvidersRepoContains should not be called unless hasAvailablePackageList is true".to_string()).into()); } diff --git a/crates/shirabe/src/repository/filesystem_repository.rs b/crates/shirabe/src/repository/filesystem_repository.rs index b39fe829..54c2fa1f 100644 --- a/crates/shirabe/src/repository/filesystem_repository.rs +++ b/crates/shirabe/src/repository/filesystem_repository.rs @@ -95,7 +95,7 @@ impl FilesystemRepository { } /// Initializes repository (reads file, or remote address). - pub(crate) fn initialize(&self) -> anyhow::Result<()> { + fn initialize(&self) -> anyhow::Result<()> { self.inner.initialize(); if !self.file.exists() { diff --git a/crates/shirabe/src/repository/path_repository.rs b/crates/shirabe/src/repository/path_repository.rs index 828474e6..680911eb 100644 --- a/crates/shirabe/src/repository/path_repository.rs +++ b/crates/shirabe/src/repository/path_repository.rs @@ -153,7 +153,7 @@ impl PathRepository { Ok(()) } - pub(crate) fn initialize(&self) -> anyhow::Result<()> { + fn initialize(&self) -> anyhow::Result<()> { self.inner.initialize(); let url_matches = self.get_url_matches()?; diff --git a/crates/shirabe/src/repository/platform_repository.rs b/crates/shirabe/src/repository/platform_repository.rs index e43892a0..7c7030f0 100644 --- a/crates/shirabe/src/repository/platform_repository.rs +++ b/crates/shirabe/src/repository/platform_repository.rs @@ -40,12 +40,12 @@ pub struct PlatformOverride { #[derive(Debug)] pub struct PlatformRepository { - pub(crate) inner: ArrayRepository, - pub(crate) version_parser: Option<VersionParser>, - pub(crate) overrides: IndexMap<String, PlatformOverride>, - pub(crate) disabled_packages: IndexMap<String, CompletePackageInterfaceHandle>, - pub(crate) platform_info: Option<PlatformInfo>, - pub(crate) hhvm_detector: Box<dyn HhvmDetectorInterface>, + inner: ArrayRepository, + version_parser: Option<VersionParser>, + overrides: IndexMap<String, PlatformOverride>, + disabled_packages: IndexMap<String, CompletePackageInterfaceHandle>, + platform_info: Option<PlatformInfo>, + hhvm_detector: Box<dyn HhvmDetectorInterface>, } impl PlatformRepository { @@ -123,7 +123,7 @@ impl PlatformRepository { } #[tracing::instrument(skip_all)] - pub(crate) fn initialize(&mut self) -> anyhow::Result<()> { + fn initialize(&mut self) -> anyhow::Result<()> { self.inner.initialize(); let platform_info = self diff --git a/crates/shirabe/src/repository/repository_set.rs b/crates/shirabe/src/repository/repository_set.rs index bd57ec20..24b11d51 100644 --- a/crates/shirabe/src/repository/repository_set.rs +++ b/crates/shirabe/src/repository/repository_set.rs @@ -50,29 +50,29 @@ pub struct RepositorySet { /// @var array[] /// @phpstan-var array<string, array<string, array{alias: string, alias_normalized: string}>> - pub(crate) root_aliases: IndexMap<String, IndexMap<String, RootAliasEntry>>, + root_aliases: IndexMap<String, IndexMap<String, RootAliasEntry>>, /// @var string[] /// @phpstan-var array<string, string> - pub(crate) root_references: IndexMap<String, String>, + root_references: IndexMap<String, String>, /// @var RepositoryInterface[] - pub(crate) repositories: Vec<RepositoryInterfaceHandle>, + repositories: Vec<RepositoryInterfaceHandle>, /// @var int[] array of stability => BasePackage::STABILITY_* value /// @phpstan-var array<key-of<BasePackage::STABILITIES>, BasePackage::STABILITY_*> - pub(crate) acceptable_stabilities: IndexMap<String, i64>, + acceptable_stabilities: IndexMap<String, i64>, /// @var int[] array of package name => BasePackage::STABILITY_* value /// @phpstan-var array<string, BasePackage::STABILITY_*> - pub(crate) stability_flags: IndexMap<String, i64>, + stability_flags: IndexMap<String, i64>, /// @var ConstraintInterface[] /// @phpstan-var array<string, ConstraintInterface> - pub(crate) root_requires: IndexMap<String, AnyConstraint>, + root_requires: IndexMap<String, AnyConstraint>, /// @var array<string, ConstraintInterface> - pub(crate) temporary_constraints: IndexMap<String, AnyConstraint>, + temporary_constraints: IndexMap<String, AnyConstraint>, /// @var bool locked: bool, diff --git a/crates/shirabe/src/repository/vcs/forgejo_driver.rs b/crates/shirabe/src/repository/vcs/forgejo_driver.rs index 54f5dddd..7687db0d 100644 --- a/crates/shirabe/src/repository/vcs/forgejo_driver.rs +++ b/crates/shirabe/src/repository/vcs/forgejo_driver.rs @@ -23,12 +23,12 @@ use shirabe_php_shim::{ #[derive(Debug)] pub struct ForgejoDriver { - pub(crate) inner: VcsDriverBase, - pub(crate) forgejo_url: Option<ForgejoUrl>, - pub(crate) repository_data: Option<ForgejoRepositoryData>, - pub(crate) git_driver: Option<GitDriver>, - pub(crate) tags: Option<IndexMap<String, String>>, - pub(crate) branches: Option<IndexMap<String, String>>, + inner: VcsDriverBase, + forgejo_url: Option<ForgejoUrl>, + repository_data: Option<ForgejoRepositoryData>, + git_driver: Option<GitDriver>, + tags: Option<IndexMap<String, String>>, + branches: Option<IndexMap<String, String>>, } impl ForgejoDriver { @@ -595,7 +595,7 @@ impl ForgejoDriver { None } - pub(crate) fn get_contents( + fn get_contents( &mut self, url: &str, fetching_repo_data: bool, diff --git a/crates/shirabe/src/repository/vcs/fossil_driver.rs b/crates/shirabe/src/repository/vcs/fossil_driver.rs index 9a0c4b2e..8ce479fd 100644 --- a/crates/shirabe/src/repository/vcs/fossil_driver.rs +++ b/crates/shirabe/src/repository/vcs/fossil_driver.rs @@ -19,12 +19,12 @@ use shirabe_php_shim::{ #[derive(Debug)] pub struct FossilDriver { - pub(crate) inner: VcsDriverBase, - pub(crate) tags: Option<IndexMap<String, String>>, - pub(crate) branches: Option<IndexMap<String, String>>, - pub(crate) root_identifier: Option<String>, - pub(crate) repo_file: Option<String>, - pub(crate) checkout_dir: String, + inner: VcsDriverBase, + tags: Option<IndexMap<String, String>>, + branches: Option<IndexMap<String, String>>, + root_identifier: Option<String>, + repo_file: Option<String>, + checkout_dir: String, } impl FossilDriver { @@ -95,7 +95,7 @@ impl FossilDriver { Ok(()) } - pub(crate) fn check_fossil(&self) -> anyhow::Result<()> { + fn check_fossil(&self) -> anyhow::Result<()> { let mut ignored_output = String::new(); if self.inner.process.borrow_mut().execute_args( ["fossil", "version"].map(|s| s.to_string()).as_ref(), @@ -112,7 +112,7 @@ impl FossilDriver { Ok(()) } - pub(crate) fn update_local_repo(&mut self) -> anyhow::Result<()> { + fn update_local_repo(&mut self) -> anyhow::Result<()> { assert!(self.repo_file.is_some()); let mut fs = Filesystem::new(None); diff --git a/crates/shirabe/src/repository/vcs/git_bitbucket_driver.rs b/crates/shirabe/src/repository/vcs/git_bitbucket_driver.rs index c3da08ff..9558e3b2 100644 --- a/crates/shirabe/src/repository/vcs/git_bitbucket_driver.rs +++ b/crates/shirabe/src/repository/vcs/git_bitbucket_driver.rs @@ -24,11 +24,11 @@ use shirabe_php_shim::{ #[derive(Debug)] pub struct GitBitbucketDriver { - pub(crate) inner: VcsDriverBase, + inner: VcsDriverBase, /// @var string - pub(crate) owner: String, + owner: String, /// @var string - pub(crate) repository: String, + repository: String, /// @var bool has_issues: bool, /// @var ?string @@ -50,7 +50,7 @@ pub struct GitBitbucketDriver { /// @var array<string, mixed> repo_data: IndexMap<String, PhpMixed>, /// @var ?VcsDriver - pub(crate) fallback_driver: Option<Box<dyn VcsDriverInterface>>, + fallback_driver: Option<Box<dyn VcsDriverInterface>>, /// @var string|null if set either git or hg vcs_type: Option<String>, } 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; diff --git a/crates/shirabe/src/repository/vcs/gitlab_driver.rs b/crates/shirabe/src/repository/vcs/gitlab_driver.rs index 669f1376..df1ad686 100644 --- a/crates/shirabe/src/repository/vcs/gitlab_driver.rs +++ b/crates/shirabe/src/repository/vcs/gitlab_driver.rs @@ -26,7 +26,7 @@ use shirabe_php_shim::{ /// Driver for GitLab API, use the Git driver for local checkouts. #[derive(Debug)] pub struct GitLabDriver { - pub(crate) inner: VcsDriverBase, + inner: VcsDriverBase, /// @phpstan-var 'https'|'http' scheme: String, namespace: String, @@ -40,10 +40,10 @@ pub struct GitLabDriver { /// @var array<int|string, string> Map of branch name to identifier branches: Option<IndexMap<String, String>>, /// Git Driver - pub(crate) git_driver: Option<GitDriver>, + git_driver: Option<GitDriver>, /// Protocol to force use of for repository URLs. /// @var string One of ssh, http - pub(crate) protocol: String, + protocol: String, /// Defaults to true unless we can make sure it is public /// @var bool defines whether the repo is private or not is_private: bool, @@ -595,10 +595,7 @@ impl GitLabDriver { } /// @return string[] where keys are named references like tags or branches and the value a sha - pub(crate) fn get_references( - &mut self, - r#type: &str, - ) -> anyhow::Result<IndexMap<String, String>> { + fn get_references(&mut self, r#type: &str) -> anyhow::Result<IndexMap<String, String>> { let per_page = 100; let mut resource: Option<String> = Some(format!( "{}/repository/{}?per_page={}", @@ -661,7 +658,7 @@ impl GitLabDriver { Ok(references) } - pub(crate) fn fetch_project(&mut self) -> anyhow::Result<()> { + fn fetch_project(&mut self) -> anyhow::Result<()> { if self.project.is_some() { return Ok(()); } @@ -694,7 +691,7 @@ impl GitLabDriver { /// @phpstan-impure /// /// @throws \RuntimeException - pub(crate) fn attempt_clone_fallback(&mut self) -> anyhow::Result<bool> { + fn attempt_clone_fallback(&mut self) -> anyhow::Result<bool> { let url = if !self.is_private { self.generate_public_url() } else { @@ -723,7 +720,7 @@ impl GitLabDriver { } /// Generate an SSH URL - pub(crate) fn generate_ssh_url(&self) -> String { + fn generate_ssh_url(&self) -> String { if self.has_nonstandard_origin { return format!( "ssh://git@{}/{}/{}.git", @@ -737,14 +734,14 @@ impl GitLabDriver { ) } - pub(crate) fn generate_public_url(&self) -> String { + fn generate_public_url(&self) -> String { format!( "{}://{}/{}/{}.git", self.scheme, self.inner.origin_url, self.namespace, self.repository ) } - pub(crate) fn setup_git_driver(&mut self, url: &str) -> anyhow::Result<()> { + fn setup_git_driver(&mut self, url: &str) -> anyhow::Result<()> { let mut repo_config: IndexMap<String, PhpMixed> = IndexMap::new(); repo_config.insert("url".to_string(), PhpMixed::String(url.to_string())); let mut git_driver = GitDriver::new( @@ -759,7 +756,7 @@ impl GitLabDriver { Ok(()) } - pub(crate) fn get_contents( + fn get_contents( &mut self, url: &str, fetching_repo_data: bool, @@ -1009,7 +1006,7 @@ impl GitLabDriver { Ok(self.project.clone()) } - 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").unwrap_or_default(); let links = explode(",", &header); diff --git a/crates/shirabe/src/repository/vcs/hg_driver.rs b/crates/shirabe/src/repository/vcs/hg_driver.rs index 56efd514..f4e02685 100644 --- a/crates/shirabe/src/repository/vcs/hg_driver.rs +++ b/crates/shirabe/src/repository/vcs/hg_driver.rs @@ -17,11 +17,11 @@ use shirabe_php_shim::{PhpMixed, RuntimeException, dirname, is_dir, is_writable, #[derive(Debug)] pub struct HgDriver { - pub(crate) inner: VcsDriverBase, - pub(crate) tags: Option<IndexMap<String, String>>, - pub(crate) branches: Option<IndexMap<String, String>>, - pub(crate) root_identifier: Option<String>, - pub(crate) repo_dir: String, + inner: VcsDriverBase, + tags: Option<IndexMap<String, String>>, + branches: Option<IndexMap<String, String>>, + root_identifier: Option<String>, + repo_dir: String, } impl HgDriver { diff --git a/crates/shirabe/src/repository/vcs/perforce_driver.rs b/crates/shirabe/src/repository/vcs/perforce_driver.rs index 7425c7d4..ce9ffb49 100644 --- a/crates/shirabe/src/repository/vcs/perforce_driver.rs +++ b/crates/shirabe/src/repository/vcs/perforce_driver.rs @@ -15,9 +15,9 @@ use shirabe_php_shim::{BadMethodCallException, PhpMixed, RuntimeException, php_r #[derive(Debug)] pub struct PerforceDriver { inner: VcsDriverBase, - pub(crate) depot: String, - pub(crate) branch: String, - pub(crate) perforce: Option<Box<dyn PerforceInterface>>, + depot: String, + branch: String, + perforce: Option<Box<dyn PerforceInterface>>, } impl PerforceDriver { diff --git a/crates/shirabe/src/repository/vcs/svn_driver.rs b/crates/shirabe/src/repository/vcs/svn_driver.rs index 6d767af5..dd74400d 100644 --- a/crates/shirabe/src/repository/vcs/svn_driver.rs +++ b/crates/shirabe/src/repository/vcs/svn_driver.rs @@ -21,25 +21,25 @@ use shirabe_php_shim::{ #[derive(Debug)] pub struct SvnDriver { - pub(crate) inner: VcsDriverBase, + inner: VcsDriverBase, /// @var string - pub(crate) base_url: String, + base_url: 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>>, + branches: Option<IndexMap<String, String>>, /// @var ?string - pub(crate) root_identifier: Option<String>, + root_identifier: Option<String>, - pub(crate) trunk_path: Option<String>, + trunk_path: Option<String>, /// @var string - pub(crate) branches_path: String, + branches_path: String, /// @var string - pub(crate) tags_path: String, + tags_path: String, /// @var string - pub(crate) package_path: String, + package_path: String, /// @var bool - pub(crate) cache_credentials: bool, + cache_credentials: bool, /// @var SvnUtil util: Option<SvnUtil>, @@ -152,7 +152,7 @@ impl SvnDriver { None } - pub(crate) fn should_cache(&self, identifier: &str) -> bool { + fn should_cache(&self, identifier: &str) -> bool { self.inner.cache.is_some() && Preg::is_match(php_regex!(r"{@\d+$}"), identifier) } @@ -530,7 +530,7 @@ impl SvnDriver { } /// An absolute path (leading '/') is converted to a file:// url. - pub(crate) fn normalize_url(url: &str) -> String { + fn normalize_url(url: &str) -> String { let fs = Filesystem::new(None); if fs.is_absolute_path(url) { return format!("file://{}", strtr(url, "\\", "/")); @@ -545,7 +545,7 @@ impl SvnDriver { /// @param non-empty-list<string> $command The svn command to run. /// @param string $url The SVN URL. /// @throws \RuntimeException - pub(crate) fn execute(&mut self, command: Vec<String>, url: &str) -> anyhow::Result<String> { + fn execute(&mut self, command: Vec<String>, url: &str) -> anyhow::Result<String> { if self.util.is_none() { self.util = Some(SvnUtil::new( self.base_url.clone(), @@ -589,7 +589,7 @@ impl SvnDriver { /// /// @param string $baseDir The path to trunk/branch/tag /// @param int $revision The revision mark to add to identifier - pub(crate) fn build_identifier(&self, base_dir: &str, revision: i64) -> String { + fn build_identifier(&self, base_dir: &str, revision: i64) -> String { format!( "{}{}/@{}", base_dir.trim_end_matches('/'), diff --git a/crates/shirabe/src/repository/vcs_repository.rs b/crates/shirabe/src/repository/vcs_repository.rs index 4da3f0ad..4066ac44 100644 --- a/crates/shirabe/src/repository/vcs_repository.rs +++ b/crates/shirabe/src/repository/vcs_repository.rs @@ -37,36 +37,36 @@ use shirabe_semver::constraint::SimpleConstraint; // TODO(port): the driver registration should be refactored later. #[derive(Debug)] pub struct VcsRepository { - pub(crate) inner: ArrayRepository, + inner: ArrayRepository, /// @var string - pub(crate) url: String, + url: String, /// @var ?string /// /// Interior mutability: set lazily by the (now `&self`) `initialize`, mirroring how PHP's /// inherited ArrayRepository methods drive the overridden `initialize()` on first access. - pub(crate) package_name: std::cell::RefCell<Option<String>>, + package_name: std::cell::RefCell<Option<String>>, /// @var bool - pub(crate) is_verbose: bool, + is_verbose: bool, /// @var bool - pub(crate) is_very_verbose: bool, + is_very_verbose: bool, /// @var IOInterface - pub(crate) io: std::rc::Rc<std::cell::RefCell<dyn IOInterface>>, + io: std::rc::Rc<std::cell::RefCell<dyn IOInterface>>, /// @var Config - pub(crate) config: std::rc::Rc<std::cell::RefCell<Config>>, + config: std::rc::Rc<std::cell::RefCell<Config>>, /// @var VersionParser - pub(crate) version_parser: std::cell::RefCell<Option<VersionParser>>, + version_parser: std::cell::RefCell<Option<VersionParser>>, /// @var string - pub(crate) r#type: String, + r#type: String, /// @var ?LoaderInterface - pub(crate) loader: std::cell::RefCell<Option<Box<dyn LoaderInterface>>>, + loader: std::cell::RefCell<Option<Box<dyn LoaderInterface>>>, /// @var array<string, mixed> - pub(crate) repo_config: IndexMap<String, PhpMixed>, + repo_config: IndexMap<String, PhpMixed>, /// @var HttpDownloader - pub(crate) http_downloader: std::rc::Rc<std::cell::RefCell<HttpDownloader>>, + http_downloader: std::rc::Rc<std::cell::RefCell<HttpDownloader>>, /// @var ProcessExecutor - pub(crate) process_executor: std::rc::Rc<std::cell::RefCell<ProcessExecutor>>, + process_executor: std::rc::Rc<std::cell::RefCell<ProcessExecutor>>, /// @var bool - pub(crate) branch_error_occurred: std::cell::Cell<bool>, + branch_error_occurred: std::cell::Cell<bool>, /// @var array<string, class-string<VcsDriverInterface>> drivers: IndexMap<String, VcsDriverKind>, /// @var ?VcsDriverInterface |
