aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe-symfony-console/src/completion
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-08-10 04:38:35 +0900
committernsfisis <nsfisis@gmail.com>2026-08-10 04:38:35 +0900
commit9d9da0d1512202af7802d13b1c3c33a1a077a84e (patch)
treeabe363b266a61da1713c6a16702b84ea68c70882 /crates/shirabe-symfony-console/src/completion
parentf38080643d80b258393f2b7ab20349b122fe4591 (diff)
downloadphp-shirabe-9d9da0d1512202af7802d13b1c3c33a1a077a84e.tar.gz
php-shirabe-9d9da0d1512202af7802d13b1c3c33a1a077a84e.tar.zst
php-shirabe-9d9da0d1512202af7802d13b1c3c33a1a077a84e.zip
refactor(symfony): hide leaf modules behind their parent re-exports
Every parent module in the symfony-* crates already re-exported its leaf modules with `pub use`, so each item was reachable by two paths. Make the leaf modules private and route all callers through the single re-exported path. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe-symfony-console/src/completion')
-rw-r--r--crates/shirabe-symfony-console/src/completion/completion_input.rs54
-rw-r--r--crates/shirabe-symfony-console/src/completion/completion_suggestions.rs4
-rw-r--r--crates/shirabe-symfony-console/src/completion/output/bash_completion_output.rs6
-rw-r--r--crates/shirabe-symfony-console/src/completion/output/completion_output_interface.rs4
4 files changed, 29 insertions, 39 deletions
diff --git a/crates/shirabe-symfony-console/src/completion/completion_input.rs b/crates/shirabe-symfony-console/src/completion/completion_input.rs
index b9785013..aef23d4a 100644
--- a/crates/shirabe-symfony-console/src/completion/completion_input.rs
+++ b/crates/shirabe-symfony-console/src/completion/completion_input.rs
@@ -1,8 +1,8 @@
//! ref: composer/vendor/symfony/console/Completion/CompletionInput.php
-use crate::input::argv_input::ArgvInput;
-use crate::input::input_definition::InputDefinition;
-use crate::input::input_option::InputOption;
+use crate::input::ArgvInput;
+use crate::input::InputDefinition;
+use crate::input::InputOption;
use shirabe_php_shim::{PhpMixed, php_regex};
/// An input specialized for shell completion.
@@ -281,10 +281,8 @@ impl CompletionInput {
/// PHP: `CompletionInput extends ArgvInput` — the inherited `InputInterface` surface,
/// forwarded to the embedded `ArgvInput`. `bind` dispatches to the specialized
/// `CompletionInput::bind` above, matching PHP's virtual dispatch.
-impl crate::input::input_interface::InputInterface for CompletionInput {
- fn dup(
- &self,
- ) -> std::rc::Rc<std::cell::RefCell<dyn crate::input::input_interface::InputInterface>> {
+impl crate::input::InputInterface for CompletionInput {
+ fn dup(&self) -> std::rc::Rc<std::cell::RefCell<dyn crate::input::InputInterface>> {
std::rc::Rc::new(std::cell::RefCell::new(self.clone()))
}
@@ -297,11 +295,7 @@ impl crate::input::input_interface::InputInterface for CompletionInput {
}
fn has_parameter_option(&self, values: PhpMixed, only_params: bool) -> bool {
- crate::input::input_interface::InputInterface::has_parameter_option(
- &self.inner,
- values,
- only_params,
- )
+ crate::input::InputInterface::has_parameter_option(&self.inner, values, only_params)
}
fn get_parameter_option(
@@ -310,7 +304,7 @@ impl crate::input::input_interface::InputInterface for CompletionInput {
default: PhpMixed,
only_params: bool,
) -> PhpMixed {
- crate::input::input_interface::InputInterface::get_parameter_option(
+ crate::input::InputInterface::get_parameter_option(
&self.inner,
values,
default,
@@ -323,59 +317,55 @@ impl crate::input::input_interface::InputInterface for CompletionInput {
}
fn validate(&mut self) -> anyhow::Result<()> {
- crate::input::input_interface::InputInterface::validate(&mut self.inner)
+ crate::input::InputInterface::validate(&mut self.inner)
}
fn get_arguments(&self) -> indexmap::IndexMap<String, PhpMixed> {
- crate::input::input_interface::InputInterface::get_arguments(&self.inner)
+ crate::input::InputInterface::get_arguments(&self.inner)
}
fn get_argument(&self, name: &str) -> anyhow::Result<PhpMixed> {
- crate::input::input_interface::InputInterface::get_argument(&self.inner, name)
+ crate::input::InputInterface::get_argument(&self.inner, name)
}
fn set_argument(&mut self, name: &str, value: PhpMixed) -> anyhow::Result<()> {
- crate::input::input_interface::InputInterface::set_argument(&mut self.inner, name, value)
+ crate::input::InputInterface::set_argument(&mut self.inner, name, value)
}
fn has_argument(&self, name: &str) -> bool {
- crate::input::input_interface::InputInterface::has_argument(&self.inner, name)
+ crate::input::InputInterface::has_argument(&self.inner, name)
}
fn get_options(&self) -> indexmap::IndexMap<String, PhpMixed> {
- crate::input::input_interface::InputInterface::get_options(&self.inner)
+ crate::input::InputInterface::get_options(&self.inner)
}
fn get_option(&self, name: &str) -> anyhow::Result<PhpMixed> {
- crate::input::input_interface::InputInterface::get_option(&self.inner, name)
+ crate::input::InputInterface::get_option(&self.inner, name)
}
fn set_option(&mut self, name: &str, value: PhpMixed) -> anyhow::Result<()> {
- crate::input::input_interface::InputInterface::set_option(&mut self.inner, name, value)
+ crate::input::InputInterface::set_option(&mut self.inner, name, value)
}
fn has_option(&self, name: &str) -> bool {
- crate::input::input_interface::InputInterface::has_option(&self.inner, name)
+ crate::input::InputInterface::has_option(&self.inner, name)
}
fn is_interactive(&self) -> bool {
- crate::input::input_interface::InputInterface::is_interactive(&self.inner)
+ crate::input::InputInterface::is_interactive(&self.inner)
}
fn set_interactive(&mut self, interactive: bool) {
- crate::input::input_interface::InputInterface::set_interactive(&mut self.inner, interactive)
+ crate::input::InputInterface::set_interactive(&mut self.inner, interactive)
}
- fn as_streamable(
- &self,
- ) -> Option<&dyn crate::input::streamable_input_interface::StreamableInputInterface> {
- crate::input::input_interface::InputInterface::as_streamable(&self.inner)
+ fn as_streamable(&self) -> Option<&dyn crate::input::StreamableInputInterface> {
+ crate::input::InputInterface::as_streamable(&self.inner)
}
- fn as_streamable_mut(
- &mut self,
- ) -> Option<&mut dyn crate::input::streamable_input_interface::StreamableInputInterface> {
- crate::input::input_interface::InputInterface::as_streamable_mut(&mut self.inner)
+ fn as_streamable_mut(&mut self) -> Option<&mut dyn crate::input::StreamableInputInterface> {
+ crate::input::InputInterface::as_streamable_mut(&mut self.inner)
}
}
diff --git a/crates/shirabe-symfony-console/src/completion/completion_suggestions.rs b/crates/shirabe-symfony-console/src/completion/completion_suggestions.rs
index dd9235ae..69fd8993 100644
--- a/crates/shirabe-symfony-console/src/completion/completion_suggestions.rs
+++ b/crates/shirabe-symfony-console/src/completion/completion_suggestions.rs
@@ -1,7 +1,7 @@
//! ref: composer/vendor/symfony/console/Completion/CompletionSuggestions.php
-use crate::completion::suggestion::Suggestion;
-use crate::input::input_option::InputOption;
+use crate::completion::Suggestion;
+use crate::input::InputOption;
/// PHP union type `string|Suggestion` used by `suggestValue`/`suggestValues`.
#[derive(Debug)]
diff --git a/crates/shirabe-symfony-console/src/completion/output/bash_completion_output.rs b/crates/shirabe-symfony-console/src/completion/output/bash_completion_output.rs
index 3af69e7f..98ca91b1 100644
--- a/crates/shirabe-symfony-console/src/completion/output/bash_completion_output.rs
+++ b/crates/shirabe-symfony-console/src/completion/output/bash_completion_output.rs
@@ -1,8 +1,8 @@
//! ref: composer/vendor/symfony/console/Completion/Output/BashCompletionOutput.php
-use crate::completion::completion_suggestions::CompletionSuggestions;
-use crate::completion::output::completion_output_interface::CompletionOutputInterface;
-use crate::output::output_interface::OutputInterface;
+use crate::completion::CompletionOutputInterface;
+use crate::completion::CompletionSuggestions;
+use crate::output::OutputInterface;
#[derive(Debug)]
pub struct BashCompletionOutput;
diff --git a/crates/shirabe-symfony-console/src/completion/output/completion_output_interface.rs b/crates/shirabe-symfony-console/src/completion/output/completion_output_interface.rs
index 1965aa14..d9245f82 100644
--- a/crates/shirabe-symfony-console/src/completion/output/completion_output_interface.rs
+++ b/crates/shirabe-symfony-console/src/completion/output/completion_output_interface.rs
@@ -1,7 +1,7 @@
//! ref: composer/vendor/symfony/console/Completion/Output/CompletionOutputInterface.php
-use crate::completion::completion_suggestions::CompletionSuggestions;
-use crate::output::output_interface::OutputInterface;
+use crate::completion::CompletionSuggestions;
+use crate::output::OutputInterface;
/// Transforms the `CompletionSuggestions` object into output readable by the shell completion.
pub trait CompletionOutputInterface: std::fmt::Debug {