aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/src/command/init_command.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/command/init_command.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/command/init_command.rs')
-rw-r--r--crates/shirabe/src/command/init_command.rs13
1 files changed, 5 insertions, 8 deletions
diff --git a/crates/shirabe/src/command/init_command.rs b/crates/shirabe/src/command/init_command.rs
index 7e6021a9..c348fa6f 100644
--- a/crates/shirabe/src/command/init_command.rs
+++ b/crates/shirabe/src/command/init_command.rs
@@ -125,10 +125,7 @@ impl InitCommand {
.into())
}
- pub(crate) fn format_authors(
- &self,
- author: &str,
- ) -> anyhow::Result<Vec<IndexMap<String, PhpMixed>>> {
+ fn format_authors(&self, author: &str) -> anyhow::Result<Vec<IndexMap<String, PhpMixed>>> {
let parsed = self.parse_author_string(author)?;
let mut author_map: IndexMap<String, PhpMixed> = IndexMap::new();
let name = parsed.get("name").cloned().unwrap_or(None);
@@ -163,7 +160,7 @@ impl InitCommand {
Some(implode("\\", &namespace))
}
- pub(crate) fn get_git_config(&self) -> IndexMap<String, String> {
+ fn get_git_config(&self) -> IndexMap<String, String> {
if self.git_config.borrow().is_some() {
return self.git_config.borrow().clone().unwrap_or_default();
}
@@ -208,7 +205,7 @@ impl InitCommand {
/// "/$vendor/"
/// "/$vendor/*"
/// "$vendor/*"
- pub(crate) fn has_vendor_ignore(&self, ignore_file: &str, vendor: &str) -> bool {
+ fn has_vendor_ignore(&self, ignore_file: &str, vendor: &str) -> bool {
if !file_exists(ignore_file) {
return false;
}
@@ -225,7 +222,7 @@ impl InitCommand {
false
}
- pub(crate) fn add_vendor_ignore(&self, ignore_file: &str, vendor: &str) {
+ fn add_vendor_ignore(&self, ignore_file: &str, vendor: &str) {
let mut contents = String::new();
if file_exists(ignore_file) {
contents = file_get_contents(ignore_file).unwrap_or_default();
@@ -269,7 +266,7 @@ impl InitCommand {
self.add_vendor_ignore(ignore_file, vendor)
}
- pub(crate) fn is_valid_email(&self, email: &str) -> bool {
+ fn is_valid_email(&self, email: &str) -> bool {
shirabe_php_shim::filter_var_email(email)
}