aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe-symfony-console/src/helper
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/helper
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/helper')
-rw-r--r--crates/shirabe-symfony-console/src/helper/debug_formatter_helper.rs6
-rw-r--r--crates/shirabe-symfony-console/src/helper/descriptor_helper.rs20
-rw-r--r--crates/shirabe-symfony-console/src/helper/formatter_helper.rs8
-rw-r--r--crates/shirabe-symfony-console/src/helper/helper.rs4
-rw-r--r--crates/shirabe-symfony-console/src/helper/helper_interface.rs2
-rw-r--r--crates/shirabe-symfony-console/src/helper/helper_set.rs10
-rw-r--r--crates/shirabe-symfony-console/src/helper/process_helper.rs16
-rw-r--r--crates/shirabe-symfony-console/src/helper/progress_bar.rs6
-rw-r--r--crates/shirabe-symfony-console/src/helper/question_helper.rs26
-rw-r--r--crates/shirabe-symfony-console/src/helper/symfony_question_helper.rs10
-rw-r--r--crates/shirabe-symfony-console/src/helper/table.rs17
-rw-r--r--crates/shirabe-symfony-console/src/helper/table_cell.rs4
-rw-r--r--crates/shirabe-symfony-console/src/helper/table_cell_style.rs2
-rw-r--r--crates/shirabe-symfony-console/src/helper/table_rows.rs2
-rw-r--r--crates/shirabe-symfony-console/src/helper/table_separator.rs8
15 files changed, 69 insertions, 72 deletions
diff --git a/crates/shirabe-symfony-console/src/helper/debug_formatter_helper.rs b/crates/shirabe-symfony-console/src/helper/debug_formatter_helper.rs
index f7fd2157..ac5d1c47 100644
--- a/crates/shirabe-symfony-console/src/helper/debug_formatter_helper.rs
+++ b/crates/shirabe-symfony-console/src/helper/debug_formatter_helper.rs
@@ -1,8 +1,8 @@
//! ref: composer/vendor/symfony/console/Helper/DebugFormatterHelper.php
-use crate::helper::helper::Helper;
-use crate::helper::helper_interface::HelperInterface;
-use crate::helper::helper_set::HelperSet;
+use crate::helper::Helper;
+use crate::helper::HelperInterface;
+use crate::helper::HelperSet;
use indexmap::IndexMap;
const COLORS: [&str; 9] = [
diff --git a/crates/shirabe-symfony-console/src/helper/descriptor_helper.rs b/crates/shirabe-symfony-console/src/helper/descriptor_helper.rs
index 23bb4f66..4ab5a93a 100644
--- a/crates/shirabe-symfony-console/src/helper/descriptor_helper.rs
+++ b/crates/shirabe-symfony-console/src/helper/descriptor_helper.rs
@@ -1,15 +1,15 @@
//! ref: composer/vendor/symfony/console/Helper/DescriptorHelper.php
-use crate::descriptor::descriptor_interface::{DescribableObject, DescriptorInterface};
-use crate::descriptor::json_descriptor::JsonDescriptor;
-use crate::descriptor::markdown_descriptor::MarkdownDescriptor;
-use crate::descriptor::text_descriptor::TextDescriptor;
-use crate::descriptor::xml_descriptor::XmlDescriptor;
-use crate::exception::invalid_argument_exception::InvalidArgumentException;
-use crate::helper::helper::Helper;
-use crate::helper::helper_interface::HelperInterface;
-use crate::helper::helper_set::HelperSet;
-use crate::output::output_interface::OutputInterface;
+use crate::descriptor::JsonDescriptor;
+use crate::descriptor::MarkdownDescriptor;
+use crate::descriptor::TextDescriptor;
+use crate::descriptor::XmlDescriptor;
+use crate::descriptor::{DescribableObject, DescriptorInterface};
+use crate::exception::InvalidArgumentException;
+use crate::helper::Helper;
+use crate::helper::HelperInterface;
+use crate::helper::HelperSet;
+use crate::output::OutputInterface;
use indexmap::IndexMap;
/// This class adds helper method to describe objects in various formats.
diff --git a/crates/shirabe-symfony-console/src/helper/formatter_helper.rs b/crates/shirabe-symfony-console/src/helper/formatter_helper.rs
index f4e1b643..546e0da2 100644
--- a/crates/shirabe-symfony-console/src/helper/formatter_helper.rs
+++ b/crates/shirabe-symfony-console/src/helper/formatter_helper.rs
@@ -1,9 +1,9 @@
//! ref: composer/vendor/symfony/console/Helper/FormatterHelper.php
-use crate::formatter::output_formatter::OutputFormatter;
-use crate::helper::helper::Helper;
-use crate::helper::helper_interface::HelperInterface;
-use crate::helper::helper_set::HelperSet;
+use crate::formatter::OutputFormatter;
+use crate::helper::Helper;
+use crate::helper::HelperInterface;
+use crate::helper::HelperSet;
/// The Formatter class provides helpers to format messages.
#[derive(Debug, Default)]
diff --git a/crates/shirabe-symfony-console/src/helper/helper.rs b/crates/shirabe-symfony-console/src/helper/helper.rs
index 0af2830f..c92b7cb1 100644
--- a/crates/shirabe-symfony-console/src/helper/helper.rs
+++ b/crates/shirabe-symfony-console/src/helper/helper.rs
@@ -1,7 +1,7 @@
//! ref: composer/vendor/symfony/console/Helper/Helper.php
-use crate::formatter::output_formatter_interface::OutputFormatterInterface;
-use crate::helper::helper_set::HelperSet;
+use crate::formatter::OutputFormatterInterface;
+use crate::helper::HelperSet;
use shirabe_php_shim::php_regex;
use shirabe_symfony_string::unicode_string::UnicodeString;
diff --git a/crates/shirabe-symfony-console/src/helper/helper_interface.rs b/crates/shirabe-symfony-console/src/helper/helper_interface.rs
index 41c0b680..9615dfa2 100644
--- a/crates/shirabe-symfony-console/src/helper/helper_interface.rs
+++ b/crates/shirabe-symfony-console/src/helper/helper_interface.rs
@@ -1,6 +1,6 @@
//! ref: composer/vendor/symfony/console/Helper/HelperInterface.php
-use crate::helper::helper_set::HelperSet;
+use crate::helper::HelperSet;
/// HelperInterface is the interface all helpers must implement.
pub trait HelperInterface: std::fmt::Debug + shirabe_php_shim::AsAny {
diff --git a/crates/shirabe-symfony-console/src/helper/helper_set.rs b/crates/shirabe-symfony-console/src/helper/helper_set.rs
index bf64f8b2..6726a4f1 100644
--- a/crates/shirabe-symfony-console/src/helper/helper_set.rs
+++ b/crates/shirabe-symfony-console/src/helper/helper_set.rs
@@ -1,10 +1,10 @@
//! ref: composer/vendor/symfony/console/Helper/HelperSet.php
-use crate::helper::debug_formatter_helper::DebugFormatterHelper;
-use crate::helper::formatter_helper::FormatterHelper;
-use crate::helper::helper_interface::HelperInterface;
-use crate::helper::process_helper::ProcessHelper;
-use crate::helper::question_helper::QuestionHelper;
+use crate::helper::DebugFormatterHelper;
+use crate::helper::FormatterHelper;
+use crate::helper::HelperInterface;
+use crate::helper::ProcessHelper;
+use crate::helper::QuestionHelper;
/// HelperSet represents a set of helpers to be used with a command.
///
diff --git a/crates/shirabe-symfony-console/src/helper/process_helper.rs b/crates/shirabe-symfony-console/src/helper/process_helper.rs
index be1c1a84..e0e94c47 100644
--- a/crates/shirabe-symfony-console/src/helper/process_helper.rs
+++ b/crates/shirabe-symfony-console/src/helper/process_helper.rs
@@ -1,12 +1,12 @@
//! ref: composer/vendor/symfony/console/Helper/ProcessHelper.php
-use crate::helper::debug_formatter_helper::DebugFormatterHelper;
-use crate::helper::helper::Helper;
-use crate::helper::helper_interface::HelperInterface;
-use crate::helper::helper_set::HelperSet;
+use crate::helper::DebugFormatterHelper;
+use crate::helper::Helper;
+use crate::helper::HelperInterface;
+use crate::helper::HelperSet;
use crate::output::ConsoleOutputInterface;
-use crate::output::output_interface::{self, OutputInterface};
-use shirabe_symfony_process::exception::process_failed_exception::ProcessFailedException;
+use crate::output::{OutputInterface, output_interface};
+use shirabe_symfony_process::exception::ProcessFailedException;
use shirabe_symfony_process::process::Process;
/// The ProcessHelper class provides helpers to run external processes.
@@ -54,7 +54,7 @@ impl ProcessHelper {
// reduces to a downcast to the concrete type.
let output: std::rc::Rc<std::cell::RefCell<dyn OutputInterface>> = {
let redirected = shirabe_php_shim::AsAny::as_any(&*output.borrow())
- .downcast_ref::<crate::output::console_output::ConsoleOutput>()
+ .downcast_ref::<crate::output::ConsoleOutput>()
.map(|console| console.get_error_output());
redirected.unwrap_or(output)
};
@@ -228,7 +228,7 @@ impl ProcessHelper {
// reduces to a downcast to the concrete type.
let output: std::rc::Rc<std::cell::RefCell<dyn OutputInterface>> = {
let redirected = shirabe_php_shim::AsAny::as_any(&*output.borrow())
- .downcast_ref::<crate::output::console_output::ConsoleOutput>()
+ .downcast_ref::<crate::output::ConsoleOutput>()
.map(|console| console.get_error_output());
redirected.unwrap_or(output)
};
diff --git a/crates/shirabe-symfony-console/src/helper/progress_bar.rs b/crates/shirabe-symfony-console/src/helper/progress_bar.rs
index 44e144cf..b0124419 100644
--- a/crates/shirabe-symfony-console/src/helper/progress_bar.rs
+++ b/crates/shirabe-symfony-console/src/helper/progress_bar.rs
@@ -1,8 +1,8 @@
//! ref: composer/vendor/symfony/console/Helper/ProgressBar.php
use crate::cursor::Cursor;
-use crate::exception::logic_exception::LogicException;
-use crate::helper::helper::Helper;
+use crate::exception::LogicException;
+use crate::helper::Helper;
use crate::output::ConsoleOutputInterface;
use crate::output::ConsoleSectionOutput;
use crate::output::OutputInterface;
@@ -73,7 +73,7 @@ impl ProgressBar {
// reduces to a downcast to the concrete type.
let output: std::rc::Rc<std::cell::RefCell<dyn OutputInterface>> = {
let redirected = shirabe_php_shim::AsAny::as_any(&*output.borrow())
- .downcast_ref::<crate::output::console_output::ConsoleOutput>()
+ .downcast_ref::<crate::output::ConsoleOutput>()
.map(|console| console.get_error_output());
redirected.unwrap_or(output)
};
diff --git a/crates/shirabe-symfony-console/src/helper/question_helper.rs b/crates/shirabe-symfony-console/src/helper/question_helper.rs
index 6ee83702..662edf40 100644
--- a/crates/shirabe-symfony-console/src/helper/question_helper.rs
+++ b/crates/shirabe-symfony-console/src/helper/question_helper.rs
@@ -1,20 +1,20 @@
//! ref: composer/vendor/symfony/console/Helper/QuestionHelper.php
use crate::cursor::Cursor;
-use crate::exception::missing_input_exception::MissingInputException;
-use crate::exception::runtime_exception::RuntimeException;
-use crate::formatter::output_formatter::OutputFormatter;
-use crate::formatter::output_formatter_style::OutputFormatterStyle;
-use crate::helper::formatter_helper::FormatBlockMessages;
-use crate::helper::helper::Helper;
-use crate::helper::helper_interface::HelperInterface;
-use crate::helper::helper_set::HelperSet;
-use crate::input::input_interface::InputInterface;
-use crate::output::console_output::ConsoleOutput;
-use crate::output::console_output_interface::ConsoleOutputInterface;
-use crate::output::console_section_output::ConsoleSectionOutput;
+use crate::exception::MissingInputException;
+use crate::exception::RuntimeException;
+use crate::formatter::OutputFormatter;
+use crate::formatter::OutputFormatterStyle;
+use crate::helper::FormatBlockMessages;
+use crate::helper::Helper;
+use crate::helper::HelperInterface;
+use crate::helper::HelperSet;
+use crate::input::InputInterface;
+use crate::output::ConsoleOutput;
+use crate::output::ConsoleOutputInterface;
+use crate::output::ConsoleSectionOutput;
+use crate::output::OutputInterface;
use crate::output::output_interface;
-use crate::output::output_interface::OutputInterface;
use crate::question::ChoiceQuestion;
use crate::question::QuestionInterface;
use crate::terminal::Terminal;
diff --git a/crates/shirabe-symfony-console/src/helper/symfony_question_helper.rs b/crates/shirabe-symfony-console/src/helper/symfony_question_helper.rs
index 9de40dd4..5b4b3ba0 100644
--- a/crates/shirabe-symfony-console/src/helper/symfony_question_helper.rs
+++ b/crates/shirabe-symfony-console/src/helper/symfony_question_helper.rs
@@ -1,12 +1,12 @@
//! ref: composer/vendor/symfony/console/Helper/SymfonyQuestionHelper.php
-use crate::formatter::output_formatter::OutputFormatter;
-use crate::helper::question_helper::{QuestionHelper, QuestionHelperInterface};
+use crate::formatter::OutputFormatter;
+use crate::helper::{QuestionHelper, QuestionHelperInterface};
+use crate::output::OutputInterface;
use crate::output::output_interface;
-use crate::output::output_interface::OutputInterface;
use crate::question::QuestionInterface;
-use crate::style::style_interface::StyleInterface;
-use crate::style::symfony_style::SymfonyStyle;
+use crate::style::StyleInterface;
+use crate::style::SymfonyStyle;
use shirabe_php_shim::PhpMixed;
use std::ops::{Deref, DerefMut};
diff --git a/crates/shirabe-symfony-console/src/helper/table.rs b/crates/shirabe-symfony-console/src/helper/table.rs
index 8f82c357..177e23c0 100644
--- a/crates/shirabe-symfony-console/src/helper/table.rs
+++ b/crates/shirabe-symfony-console/src/helper/table.rs
@@ -1,12 +1,12 @@
//! ref: composer/vendor/symfony/console/Helper/Table.php
-use crate::exception::invalid_argument_exception::InvalidArgumentException;
-use crate::formatter::output_formatter::OutputFormatter;
-use crate::formatter::wrappable_output_formatter_interface::WrappableOutputFormatterInterface;
+use crate::exception::InvalidArgumentException;
+use crate::formatter::OutputFormatter;
+use crate::formatter::WrappableOutputFormatterInterface;
use crate::helper::{
Helper, TableCell, TableCellOption, TableCellStyle, TableRows, TableSeparator, TableStyle,
};
-use crate::output::output_interface::OutputInterface;
+use crate::output::OutputInterface;
use indexmap::IndexMap;
use shirabe_pcre::preg::Preg;
use shirabe_php_shim::{PhpMixed, php_regex};
@@ -568,7 +568,7 @@ impl Table {
&self.style.get_border_format(),
&[PhpMixed::from(markup)],
)],
- crate::output::output_interface::OUTPUT_NORMAL,
+ crate::output::OUTPUT_NORMAL,
);
}
@@ -608,10 +608,9 @@ impl Table {
BORDER_INSIDE
}));
}
- self.output.borrow().writeln(
- &[row_content],
- crate::output::output_interface::OUTPUT_NORMAL,
- );
+ self.output
+ .borrow()
+ .writeln(&[row_content], crate::output::OUTPUT_NORMAL);
}
/// Renders table cell with padding.
diff --git a/crates/shirabe-symfony-console/src/helper/table_cell.rs b/crates/shirabe-symfony-console/src/helper/table_cell.rs
index 100872ca..fdcda7b8 100644
--- a/crates/shirabe-symfony-console/src/helper/table_cell.rs
+++ b/crates/shirabe-symfony-console/src/helper/table_cell.rs
@@ -1,7 +1,7 @@
//! ref: composer/vendor/symfony/console/Helper/TableCell.php
-use crate::exception::invalid_argument_exception::InvalidArgumentException;
-use crate::helper::table_cell_style::TableCellStyle;
+use crate::exception::InvalidArgumentException;
+use crate::helper::TableCellStyle;
use indexmap::IndexMap;
/// A `TableCell` option value: an integer span, a `TableCellStyle`, or null.
diff --git a/crates/shirabe-symfony-console/src/helper/table_cell_style.rs b/crates/shirabe-symfony-console/src/helper/table_cell_style.rs
index 6f0d6b5c..3a95e2ce 100644
--- a/crates/shirabe-symfony-console/src/helper/table_cell_style.rs
+++ b/crates/shirabe-symfony-console/src/helper/table_cell_style.rs
@@ -1,6 +1,6 @@
//! ref: composer/vendor/symfony/console/Helper/TableCellStyle.php
-use crate::exception::invalid_argument_exception::InvalidArgumentException;
+use crate::exception::InvalidArgumentException;
use indexmap::IndexMap;
pub const DEFAULT_ALIGN: &str = "left";
diff --git a/crates/shirabe-symfony-console/src/helper/table_rows.rs b/crates/shirabe-symfony-console/src/helper/table_rows.rs
index dea05384..214ebab0 100644
--- a/crates/shirabe-symfony-console/src/helper/table_rows.rs
+++ b/crates/shirabe-symfony-console/src/helper/table_rows.rs
@@ -1,6 +1,6 @@
//! ref: composer/vendor/symfony/console/Helper/TableRows.php
-use crate::helper::table::Row;
+use crate::helper::Row;
/// @internal
///
diff --git a/crates/shirabe-symfony-console/src/helper/table_separator.rs b/crates/shirabe-symfony-console/src/helper/table_separator.rs
index 898a6630..7c1735c6 100644
--- a/crates/shirabe-symfony-console/src/helper/table_separator.rs
+++ b/crates/shirabe-symfony-console/src/helper/table_separator.rs
@@ -1,7 +1,7 @@
//! ref: composer/vendor/symfony/console/Helper/TableSeparator.php
-use crate::exception::invalid_argument_exception::InvalidArgumentException;
-use crate::helper::table_cell::{TableCell, TableCellOption};
+use crate::exception::InvalidArgumentException;
+use crate::helper::{TableCell, TableCellOption};
use indexmap::IndexMap;
/// Marks a row as being a separator.
@@ -30,9 +30,7 @@ impl TableSeparator {
self.inner.get_rowspan()
}
- pub fn get_style(
- &self,
- ) -> Option<std::rc::Rc<crate::helper::table_cell_style::TableCellStyle>> {
+ pub fn get_style(&self) -> Option<std::rc::Rc<crate::helper::TableCellStyle>> {
self.inner.get_style()
}
}