diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-06-25 14:39:00 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-06-25 23:47:47 +0900 |
| commit | d0336078c5b63b174e7313d54d973a1832228928 (patch) | |
| tree | b0ed23c382e7ffd854fd3afb266a6932002e3335 /crates/shirabe-external-packages/src/symfony/console | |
| parent | eebba7ebad103a2f7afe885a25ba2e96efddbd89 (diff) | |
| download | php-shirabe-d0336078c5b63b174e7313d54d973a1832228928.tar.gz php-shirabe-d0336078c5b63b174e7313d54d973a1832228928.tar.zst php-shirabe-d0336078c5b63b174e7313d54d973a1832228928.zip | |
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) <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe-external-packages/src/symfony/console')
| -rw-r--r-- | crates/shirabe-external-packages/src/symfony/console/helper/table.rs | 13 |
1 files changed, 10 insertions, 3 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 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<RefCell<dyn OutputInterface>>) -> 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::<dyn WrappableOutputFormatterInterface>(); todo!() } @@ -1260,9 +1263,13 @@ impl Table { Helper::remove_decoration(&mut *formatter, string) } - fn output_is_console_section(_output: &Rc<RefCell<dyn OutputInterface>>) -> bool { + fn output_is_console_section(output: &Rc<RefCell<dyn OutputInterface>>) -> bool { // PHP: $this->output instanceof ConsoleSectionOutput - todo!() + let borrowed = output.borrow(); + (*borrowed) + .as_any() + .downcast_ref::<ConsoleSectionOutput>() + .is_some() } fn is_divider(_row: &PhpMixed, _divider: &TableSeparator) -> bool { |
