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/command/show_command.rs | |
| 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/command/show_command.rs')
| -rw-r--r-- | crates/shirabe/src/command/show_command.rs | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/crates/shirabe/src/command/show_command.rs b/crates/shirabe/src/command/show_command.rs index f2246cbe..ead034da 100644 --- a/crates/shirabe/src/command/show_command.rs +++ b/crates/shirabe/src/command/show_command.rs @@ -55,8 +55,8 @@ use shirabe_symfony_console::output::OutputInterface; pub struct ShowCommand { base_command_data: BaseCommandData, - pub(crate) version_parser: std::cell::RefCell<VersionParser>, - pub(crate) colors: std::cell::RefCell<Vec<String>>, + version_parser: std::cell::RefCell<VersionParser>, + colors: std::cell::RefCell<Vec<String>>, repository_set: std::cell::RefCell<Option<std::rc::Rc<std::cell::RefCell<RepositorySet>>>>, } @@ -83,7 +83,7 @@ impl ShowCommand { } /// PHP: protected function suggestPackageBasedOnMode(): \Closure - pub(crate) fn suggest_package_based_on_mode(&self) -> crate::console::input::SuggestedValues { + fn suggest_package_based_on_mode(&self) -> crate::console::input::SuggestedValues { crate::console::input::SuggestedValues::Closure(Box::new(|this, input, suggestions| { if input.get_option("available")?.to_bool() || input.get_option("all")?.to_bool() { return this.suggest_available_package_incl_platform().call( @@ -259,7 +259,7 @@ impl ShowCommand { } } - pub(crate) fn get_root_requires(&self) -> Vec<String> { + fn get_root_requires(&self) -> Vec<String> { let composer_rc = self.try_composer(None, None); let composer_rc = match composer_rc { None => return vec![], @@ -279,7 +279,7 @@ impl ShowCommand { combined.keys().map(|k| strtolower(k)).collect() } - pub(crate) fn get_version_style( + fn get_version_style( &self, latest_package: PackageInterfaceHandle, package: PackageInterfaceHandle, @@ -294,7 +294,7 @@ impl ShowCommand { } /// finds a package by name and version if provided - pub(crate) fn get_package( + fn get_package( &self, installed_repo: &RepositoryInterfaceHandle, repos: &RepositoryInterfaceHandle, @@ -371,7 +371,7 @@ impl ShowCommand { } /// Prints package info. - pub(crate) fn print_package_info( + fn print_package_info( &self, package: CompletePackageInterfaceHandle, versions: &IndexMap<String, String>, @@ -401,7 +401,7 @@ impl ShowCommand { } /// Prints package metadata. - pub(crate) fn print_meta( + fn print_meta( &self, package: CompletePackageInterfaceHandle, versions: &IndexMap<String, String>, @@ -564,7 +564,7 @@ impl ShowCommand { } /// Prints all available versions of this package and highlights the installed one if any. - pub(crate) fn print_versions( + fn print_versions( &self, package: CompletePackageInterfaceHandle, versions: &IndexMap<String, String>, @@ -599,7 +599,7 @@ impl ShowCommand { } /// print link objects - pub(crate) fn print_links( + fn print_links( &self, package: CompletePackageInterfaceHandle, link_type: &str, @@ -622,7 +622,7 @@ impl ShowCommand { } /// Prints the licenses of a package with metadata - pub(crate) fn print_licenses(&self, package: CompletePackageInterfaceHandle) { + fn print_licenses(&self, package: CompletePackageInterfaceHandle) { let spdx_licenses = SpdxLicenses::new(); let licenses = package.get_license(); @@ -650,7 +650,7 @@ impl ShowCommand { } /// Prints package info in JSON format. - pub(crate) fn print_package_info_as_json( + fn print_package_info_as_json( &self, package: CompletePackageInterfaceHandle, versions: &IndexMap<String, String>, @@ -971,7 +971,7 @@ impl ShowCommand { } /// Init styles for tree - pub(crate) fn init_styles(&self, output: std::rc::Rc<std::cell::RefCell<dyn OutputInterface>>) { + fn init_styles(&self, output: std::rc::Rc<std::cell::RefCell<dyn OutputInterface>>) { *self.colors.borrow_mut() = vec![ "green".to_string(), "yellow".to_string(), @@ -991,7 +991,7 @@ impl ShowCommand { } /// Display the tree - pub(crate) fn display_package_tree(&self, array_tree: Vec<IndexMap<String, PhpMixed>>) { + fn display_package_tree(&self, array_tree: Vec<IndexMap<String, PhpMixed>>) { for package in array_tree.iter() { let name = package .get("name") @@ -1070,7 +1070,7 @@ impl ShowCommand { } /// Generate the package tree - pub(crate) fn generate_package_tree( + fn generate_package_tree( &self, package: PackageInterfaceHandle, installed_repo: &RepositoryInterfaceHandle, @@ -1147,7 +1147,7 @@ impl ShowCommand { } /// Display a package tree - pub(crate) fn display_tree( + fn display_tree( &self, package: &PhpMixed, packages_in_tree: &[PhpMixed], @@ -1216,7 +1216,7 @@ impl ShowCommand { } /// Display a package tree - pub(crate) fn add_tree( + fn add_tree( &self, name: &str, link: &Link, |
