From 7f14217abbba2f89ae5845d63c8f97b606354f45 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Mon, 20 Jul 2026 05:55:46 +0900 Subject: fix(io): widen IOInterface::select choices to PhpMixed for assoc arrays PHP's IOInterface::select accepts an associative choices array whose keys are the selectable values, but the port narrowed it to Vec, making key-based selection unrepresentable. Accept PhpMixed (List or Array) like PHP's array $choices; ConsoleIO already branched on both shapes internally. Also mirror PHP in the single-select array_search fallback for numeric-keyed arrays. All call sites keep their previous list-based behavior. Co-Authored-By: Claude Fable 5 --- crates/shirabe/tests/common/io_mock.rs | 2 +- crates/shirabe/tests/common/io_stub.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'crates/shirabe/tests/common') diff --git a/crates/shirabe/tests/common/io_mock.rs b/crates/shirabe/tests/common/io_mock.rs index 47f4b66b..a658c5bc 100644 --- a/crates/shirabe/tests/common/io_mock.rs +++ b/crates/shirabe/tests/common/io_mock.rs @@ -258,7 +258,7 @@ impl IOInterfaceImmutable for IOMock { fn select( &self, question: String, - choices: Vec, + choices: PhpMixed, default: PhpMixed, attempts: PhpMixed, error_message: String, diff --git a/crates/shirabe/tests/common/io_stub.rs b/crates/shirabe/tests/common/io_stub.rs index d582447c..b897305e 100644 --- a/crates/shirabe/tests/common/io_stub.rs +++ b/crates/shirabe/tests/common/io_stub.rs @@ -246,7 +246,7 @@ impl IOInterfaceImmutable for IOStub { fn select( &self, _question: String, - _choices: Vec, + _choices: PhpMixed, default: PhpMixed, _attempts: PhpMixed, _error_message: String, -- cgit v1.3.1