From b8050d0f9af177d4c93aa096df7f759d027a0e66 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Fri, 26 Jun 2026 02:42:32 +0900 Subject: feat(output-style): implement is_console_output_interface via AsAny downcast Matches the SymfonyStyle fix: ConsoleOutput is the sole ConsoleOutputInterface implementor, so the instanceof check reduces to an AsAny downcast. get_error_output now resolves correctly for non-console outputs instead of hitting todo!(). Co-Authored-By: Claude Opus 4.8 (1M context) --- .../src/symfony/console/style/output_style.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'crates/shirabe-external-packages/src/symfony/console') diff --git a/crates/shirabe-external-packages/src/symfony/console/style/output_style.rs b/crates/shirabe-external-packages/src/symfony/console/style/output_style.rs index 7899bbc..9a16274 100644 --- a/crates/shirabe-external-packages/src/symfony/console/style/output_style.rs +++ b/crates/shirabe-external-packages/src/symfony/console/style/output_style.rs @@ -38,8 +38,12 @@ impl OutputStyle { .get_error_output() } - fn is_console_output_interface(_output: &Rc>) -> bool { - todo!() + fn is_console_output_interface(output: &Rc>) -> bool { + // 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::() + .is_some() } fn as_console_output_interface( -- cgit v1.3.1