From f299bf44f6f19e84110b5fb39c440e2e81ab8310 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Mon, 20 Jul 2026 05:20:59 +0900 Subject: 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 --- .../src/symfony/console/helper/table.rs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'crates/shirabe-external-packages/src/symfony/console/helper') 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>, ) -> 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::(); - 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)`. -- cgit v1.3.1