From 3a883e6912e642a1bcfe68336007eae018207308 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Thu, 25 Jun 2026 15:37:21 +0900 Subject: test: port 35 auth/installer/io/zip/bitbucket tests; implement date_create Port auth_helper (14), library_installer (8), console_io (7), zip_downloader (3), git_bitbucket_driver (3) tests. Implement date_create/strtotime for the ISO8601/ RFC3339/relative formats Composer uses (unknown input -> None, no silent guess). Fix production bugs: Question::is_assoc list-vs-assoc, auth_helper gitlab-domains list handling, LibraryInstaller RefCell double-borrow, ZipArchive::extract_to ErrorException propagation. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../src/symfony/console/question/question.rs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'crates/shirabe-external-packages/src') diff --git a/crates/shirabe-external-packages/src/symfony/console/question/question.rs b/crates/shirabe-external-packages/src/symfony/console/question/question.rs index c93a71e..2ff5f62 100644 --- a/crates/shirabe-external-packages/src/symfony/console/question/question.rs +++ b/crates/shirabe-external-packages/src/symfony/console/question/question.rs @@ -304,10 +304,16 @@ impl Question { } // PHP: `(bool) \count(array_filter(array_keys($array), 'is_string'))`. - // PhpMixed models a PHP array as either `List` (sequential int keys) or `Array` - // (string-keyed map), so the "has string keys" test reduces to the `Array` variant. + // A `List` has only sequential int keys, so it is never associative. An `Array` is + // associative only when at least one key is a genuine string key; PHP normalizes + // canonical-integer string keys (e.g. "0", "12") back to int keys, so those do not count. + // The same heuristic (a key is "string" iff it does not parse as an i64) is used by + // ConsoleIO::select when computing `$isAssoc` over the choice map. pub(crate) fn is_assoc(array: &PhpMixed) -> bool { - matches!(array, PhpMixed::Array(_)) + match array { + PhpMixed::Array(map) => map.keys().any(|key| key.parse::().is_err()), + _ => false, + } } pub fn is_trimmable(&self) -> bool { -- cgit v1.3.1