From cbb5118318706dc023eb8551b1f2628f395a6228 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Fri, 26 Jun 2026 01:55:03 +0900 Subject: refactor(symfony-table): model rows/cells with enums instead of PhpMixed The Table helper modeled a row's cells as PhpMixed and recovered the concrete TableCell/TableSeparator types via runtime instance_of, leaving the entire mixed/array bridge (to_row_vec, cell_colspan, row_get, ...) as todo!(). Replace that with proper Row/Cell enums: Row = HeaderDivider | Separator(TableSeparator) | Cells(Vec) Cell = Null | Value(String) | Cell(TableCell) | Separator(TableSeparator) The internal header/body boundary that PHP detects by object identity ($divider === $row) becomes the dedicated Row::HeaderDivider variant. Style arguments (PHP string|TableStyle) become a StyleName enum, so Table::new no longer panics in resolve_style's instance_of stub; TableStyle derives Clone so named styles resolve from the registry. PhpMixed-based callers (SymfonyStyle::table, render_table, auditor's sanitize) bridge via From for Cell/Row at the boundary. Un-ignores LicensesCommandTest text-format cases (4) and BaseDependencyCommandTest::why; output matches PHP exactly. Removes ~15 impl todo!()s in the Table helper. Co-Authored-By: Claude Opus 4.8 (1M context) --- crates/shirabe/tests/command/base_dependency_command_test.rs | 1 - 1 file changed, 1 deletion(-) (limited to 'crates/shirabe/tests/command/base_dependency_command_test.rs') diff --git a/crates/shirabe/tests/command/base_dependency_command_test.rs b/crates/shirabe/tests/command/base_dependency_command_test.rs index ed0c601..95991ae 100644 --- a/crates/shirabe/tests/command/base_dependency_command_test.rs +++ b/crates/shirabe/tests/command/base_dependency_command_test.rs @@ -285,7 +285,6 @@ fn test_warning_when_dependencies_are_not_installed() { /// ref: BaseDependencyCommandTest::testWhyCommandOutputs (caseWhyProvider rolled in). #[test] #[serial] -#[ignore = "panics in shirabe_php_shim::var::instance_of (crates/shirabe-php-shim/src/var.rs:191): PHP `instanceof` is not modeled (PhpMixed carries no runtime class), reached on the `why` command execution path"] fn test_why_command_outputs() { // caseWhyProvider: (package, --tree, --recursive, expected_output, expected_status_code) let cases: Vec<(&str, bool, bool, &str, i32)> = vec![ -- cgit v1.3.1