diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-06-07 11:03:13 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-06-07 11:03:13 +0900 |
| commit | 3a6e69596d4f45ba1c50c6e932004e2160799d0c (patch) | |
| tree | 1f7175962e5c043b362fe3e82a46beb8fa2fbb40 /crates/shirabe/src/util/auth_helper.rs | |
| parent | e1053c6881da1bba409a16783e01a89248507a66 (diff) | |
| download | php-shirabe-3a6e69596d4f45ba1c50c6e932004e2160799d0c.tar.gz php-shirabe-3a6e69596d4f45ba1c50c6e932004e2160799d0c.tar.zst php-shirabe-3a6e69596d4f45ba1c50c6e932004e2160799d0c.zip | |
feat(shirabe): resolve phase-b PhpMixed conversion TODOs
Implement self-contained call sites that wrap/unwrap PhpMixed without
touching shim bodies: platform-override and authentication IndexMap to
PhpMixed conversions, and dev-package-name / version-alias sorts via
usort with strcmp/strnatcmp. Drop stale TODO comments where the
PhpMixed unwrap was already inlined.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe/src/util/auth_helper.rs')
| -rw-r--r-- | crates/shirabe/src/util/auth_helper.rs | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/crates/shirabe/src/util/auth_helper.rs b/crates/shirabe/src/util/auth_helper.rs index 2709751..7c1691b 100644 --- a/crates/shirabe/src/util/auth_helper.rs +++ b/crates/shirabe/src/util/auth_helper.rs @@ -102,8 +102,14 @@ impl AuthHelper { if store.is_some() { config_source.add_config_setting( &format!("http-basic.{}", origin), - // TODO(phase-b): convert IOInterface auth IndexMap into PhpMixed - todo!("IOInterface.get_authentication(origin) as PhpMixed"), + PhpMixed::Array( + self.io + .borrow() + .get_authentication(origin) + .into_iter() + .map(|(k, v)| (k, Box::new(v.map_or(PhpMixed::Null, PhpMixed::String)))) + .collect(), + ), )?; } Ok(()) @@ -440,7 +446,6 @@ impl AuthHelper { password, ); // PHP: $this->config->get('store-auths') returns 'prompt'|bool - // TODO(phase-b): decode the PhpMixed result into StoreAuth store_auth = match self.config.borrow_mut().get("store-auths") { PhpMixed::Bool(b) => StoreAuth::Bool(b), PhpMixed::String(ref s) if s == "prompt" => StoreAuth::Prompt, @@ -467,7 +472,6 @@ impl AuthHelper { options.insert("http".to_string(), PhpMixed::Array(IndexMap::new())); } // PHP: if (!isset($options['http']['header'])) - // TODO(phase-b): mutate nested PhpMixed in place rather than copying { let http_has_header = if let Some(PhpMixed::Array(http)) = options.get("http") { http.contains_key("header") |
