aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe-external-packages/src/symfony/console/helper
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-07-20 05:20:59 +0900
committernsfisis <nsfisis@gmail.com>2026-07-20 05:20:59 +0900
commitf299bf44f6f19e84110b5fb39c440e2e81ab8310 (patch)
tree786d0657a6740fd9fe1f14b47bbbb6d3a1fe7340 /crates/shirabe-external-packages/src/symfony/console/helper
parent10f77452e1f335e0f9eac3997d393dedf801c2c5 (diff)
downloadphp-shirabe-f299bf44f6f19e84110b5fb39c440e2e81ab8310.tar.gz
php-shirabe-f299bf44f6f19e84110b5fb39c440e2e81ab8310.tar.zst
php-shirabe-f299bf44f6f19e84110b5fb39c440e2e81ab8310.zip
fix(symfony-table): implement formatter_is_wrappable
The PHP instanceof WrappableOutputFormatterInterface check always holds here: OutputFormatter is the sole OutputFormatterInterface implementor in the port and it implements the wrappable interface, so the former todo!() can return true for every representable formatter. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe-external-packages/src/symfony/console/helper')
-rw-r--r--crates/shirabe-external-packages/src/symfony/console/helper/table.rs11
1 files changed, 4 insertions, 7 deletions
diff --git a/crates/shirabe-external-packages/src/symfony/console/helper/table.rs b/crates/shirabe-external-packages/src/symfony/console/helper/table.rs
index c5d7e346..ca0802d0 100644
--- a/crates/shirabe-external-packages/src/symfony/console/helper/table.rs
+++ b/crates/shirabe-external-packages/src/symfony/console/helper/table.rs
@@ -4,7 +4,6 @@ use crate::composer::pcre::preg::Preg;
use crate::symfony::console::exception::invalid_argument_exception::InvalidArgumentException;
use crate::symfony::console::exception::runtime_exception::RuntimeException;
use crate::symfony::console::formatter::output_formatter::OutputFormatter;
-use crate::symfony::console::formatter::wrappable_output_formatter_interface::WrappableOutputFormatterInterface;
use crate::symfony::console::helper::helper::Helper;
use crate::symfony::console::helper::table_cell::{TableCell, TableCellOption};
use crate::symfony::console::helper::table_cell_style::TableCellStyle;
@@ -1384,12 +1383,10 @@ impl Table {
fn formatter_is_wrappable(
_output: &std::rc::Rc<std::cell::RefCell<dyn OutputInterface>>,
) -> bool {
- // PHP: $this->output->getFormatter() instanceof WrappableOutputFormatterInterface
- // TODO(phase-c/d): instanceof on `dyn OutputFormatterInterface` needs an AsAny supertrait
- // on OutputFormatterInterface to downcast to the concrete wrappable formatter; adding it
- // would touch output_formatter_interface.rs, which is out of scope for this file.
- let _ = std::any::type_name::<dyn WrappableOutputFormatterInterface>();
- todo!()
+ // PHP: $this->output->getFormatter() instanceof WrappableOutputFormatterInterface.
+ // The sole OutputFormatterInterface implementor in this port is OutputFormatter, which
+ // implements WrappableOutputFormatterInterface, so the instanceof check always holds.
+ true
}
/// PHP `Helper::removeDecoration($this->output->getFormatter(), $string)`.