aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe-symfony-console/src/style
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/style
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/style')
-rw-r--r--crates/shirabe-symfony-console/src/style/output_style.rs8
-rw-r--r--crates/shirabe-symfony-console/src/style/symfony_style.rs14
2 files changed, 11 insertions, 11 deletions
diff --git a/crates/shirabe-symfony-console/src/style/output_style.rs b/crates/shirabe-symfony-console/src/style/output_style.rs
index 17c9489e..2881547d 100644
--- a/crates/shirabe-symfony-console/src/style/output_style.rs
+++ b/crates/shirabe-symfony-console/src/style/output_style.rs
@@ -3,8 +3,8 @@
use crate::formatter::OutputFormatterInterface;
use crate::helper::ProgressBar;
use crate::output::ConsoleOutputInterface;
+use crate::output::OUTPUT_NORMAL;
use crate::output::OutputInterface;
-use crate::output::output_interface::OUTPUT_NORMAL;
/// Decorates output to add console style guide helpers.
#[derive(Debug)]
@@ -50,7 +50,7 @@ impl OutputStyle {
// ConsoleOutput is the only OutputInterface implementor that also implements
// ConsoleOutputInterface, so `instanceof ConsoleOutputInterface` reduces to this downcast.
shirabe_php_shim::AsAny::as_any(&*output.borrow())
- .downcast_ref::<crate::output::console_output::ConsoleOutput>()
+ .downcast_ref::<crate::output::ConsoleOutput>()
.is_some()
}
@@ -58,11 +58,11 @@ impl OutputStyle {
/// borrow of the concrete type serves as the cast result.
fn as_console_output_interface(
output: &std::rc::Rc<std::cell::RefCell<dyn OutputInterface>>,
- ) -> Option<std::cell::Ref<'_, crate::output::console_output::ConsoleOutput>> {
+ ) -> Option<std::cell::Ref<'_, crate::output::ConsoleOutput>> {
std::cell::Ref::filter_map(output.borrow(), |output| {
output
.as_any()
- .downcast_ref::<crate::output::console_output::ConsoleOutput>()
+ .downcast_ref::<crate::output::ConsoleOutput>()
})
.ok()
}
diff --git a/crates/shirabe-symfony-console/src/style/symfony_style.rs b/crates/shirabe-symfony-console/src/style/symfony_style.rs
index 486acf2e..ead056d5 100644
--- a/crates/shirabe-symfony-console/src/style/symfony_style.rs
+++ b/crates/shirabe-symfony-console/src/style/symfony_style.rs
@@ -1,22 +1,22 @@
//! ref: composer/vendor/symfony/console/Style/SymfonyStyle.php
-use crate::exception::invalid_argument_exception::InvalidArgumentException;
+use crate::exception::InvalidArgumentException;
use crate::formatter::OutputFormatter;
use crate::formatter::OutputFormatterInterface;
use crate::helper::Helper;
use crate::helper::ProgressBar;
+use crate::helper::QuestionHelperInterface;
use crate::helper::SymfonyQuestionHelper;
use crate::helper::Table;
use crate::helper::TableCell;
use crate::helper::TableSeparator;
-use crate::helper::question_helper::QuestionHelperInterface;
-use crate::helper::table::{Cell, Row};
+use crate::helper::{Cell, Row};
use crate::input::InputInterface;
+use crate::output::ConsoleOutput;
use crate::output::ConsoleOutputInterface;
+use crate::output::OUTPUT_NORMAL;
use crate::output::OutputInterface;
use crate::output::TrimmedBufferOutput;
-use crate::output::console_output::ConsoleOutput;
-use crate::output::output_interface::OUTPUT_NORMAL;
use crate::question::ChoiceQuestion;
use crate::question::ConfirmationQuestion;
use crate::question::Question;
@@ -161,7 +161,7 @@ impl SymfonyStyle {
let mut options = indexmap::IndexMap::new();
options.insert(
"colspan".to_string(),
- crate::helper::table_cell::TableCellOption::Int(2),
+ crate::helper::TableCellOption::Int(2),
);
options
})
@@ -261,7 +261,7 @@ impl SymfonyStyle {
style.set_cell_header_format("<info>%s</info>".to_string());
let mut table = Table::new(output);
- let _ = table.set_style(crate::helper::table::StyleName::Style(style));
+ let _ = table.set_style(crate::helper::StyleName::Style(style));
table
}