From d0336078c5b63b174e7313d54d973a1832228928 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Thu, 25 Jun 2026 14:39:00 +0900 Subject: feat(external-packages,shim): implement impl todos across components Port seld/jsonlint JsonParser (+hand-written Lexer), unblocking 10 json_file parse-error tests verified byte-for-byte against PHP. Implement Symfony Finder SplFileInfo, executable finders, String classes (byte/code-point/unicode), ZipArchive shim (via the zip crate), SPDX license validation, and shim date/stream functions. Genuinely-blocked sites (reflection, PHP runtime constants, non-UTF-8 transcoding, recursive PCRE) stay todo!() with reasons. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../src/symfony/console/helper/table.rs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'crates/shirabe-external-packages/src/symfony/console') 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 1167d63..bc426f6 100644 --- a/crates/shirabe-external-packages/src/symfony/console/helper/table.rs +++ b/crates/shirabe-external-packages/src/symfony/console/helper/table.rs @@ -14,6 +14,7 @@ use crate::symfony::console::helper::table_style::TableStyle; use crate::symfony::console::output::console_section_output::ConsoleSectionOutput; use crate::symfony::console::output::output_interface::OutputInterface; use indexmap::IndexMap; +use shirabe_php_shim::AsAny; use shirabe_php_shim::PhpMixed; use std::cell::RefCell; use std::rc::Rc; @@ -1248,7 +1249,9 @@ impl Table { fn formatter_is_wrappable(_output: &Rc>) -> bool { // PHP: $this->output->getFormatter() instanceof WrappableOutputFormatterInterface - // TODO(phase-b): trait-to-trait instanceof check requires concrete formatter knowledge. + // 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!() } @@ -1260,9 +1263,13 @@ impl Table { Helper::remove_decoration(&mut *formatter, string) } - fn output_is_console_section(_output: &Rc>) -> bool { + fn output_is_console_section(output: &Rc>) -> bool { // PHP: $this->output instanceof ConsoleSectionOutput - todo!() + let borrowed = output.borrow(); + (*borrowed) + .as_any() + .downcast_ref::() + .is_some() } fn is_divider(_row: &PhpMixed, _divider: &TableSeparator) -> bool { -- cgit v1.3.1