diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-06-08 11:26:03 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-06-08 11:26:03 +0900 |
| commit | e5b789616ec4c1cbd152c5ccbefe2d27ced4a18f (patch) | |
| tree | 7a713cf1bcec30a1c69d5c434d8df6a7525dcbc2 /crates/shirabe/src/command/require_command.rs | |
| parent | 7439cdb08afe0882186a34f70c1e8878fcb7dca5 (diff) | |
| download | php-shirabe-e5b789616ec4c1cbd152c5ccbefe2d27ced4a18f.tar.gz php-shirabe-e5b789616ec4c1cbd152c5ccbefe2d27ced4a18f.tar.zst php-shirabe-e5b789616ec4c1cbd152c5ccbefe2d27ced4a18f.zip | |
feat(phase-c): resolve PHP-array-semantics phase-b TODOs
Resolve category K (array_* functions, integer keys, nested mutation,
sorting). Add shim variants (uasort over Vec<T>, uasort_map for IndexMap)
and delegate to existing typed variants (strtr_array, array_merge_map,
array_search_in_vec). Implement PHP array semantics directly where the
shape is fixed: canonical integer-key coercion (is_php_integer_key,
shared by config and FilesystemRepository::dumpToPhpCode), strict
array_search via trait-object pointer identity, array_reverse/array_chunk
preserve_keys loops, and the installed.php nested version mutations via
auto-vivify helpers.
Resolving the array_merge in UpdateCommand unmasked latent borrow bugs in
execute's tail (Rc input/output moved by value); fixed with .clone() to
match PHP reference sharing, and resolved the tightly-coupled Intervals
constraint check.
composerRequire reclassified to phase-c: it depends on the $GLOBALS
superglobal and PHP's require include mechanism, neither portable.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe/src/command/require_command.rs')
| -rw-r--r-- | crates/shirabe/src/command/require_command.rs | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/crates/shirabe/src/command/require_command.rs b/crates/shirabe/src/command/require_command.rs index 0ec809c..7fa4793 100644 --- a/crates/shirabe/src/command/require_command.rs +++ b/crates/shirabe/src/command/require_command.rs @@ -9,9 +9,8 @@ use shirabe_external_packages::symfony::console::input::InputInterface; use shirabe_external_packages::symfony::console::output::OutputInterface; use shirabe_php_shim::{ PhpMixed, RuntimeException, UnexpectedValueException, array_fill_keys, array_intersect, - array_keys, array_map, array_merge, array_merge_recursive, array_unique, count, empty, - file_exists, file_get_contents, file_put_contents, filesize, implode, is_writable, sprintf, - strtolower, unlink, + array_keys, array_map, array_merge, array_unique, count, empty, file_exists, file_get_contents, + file_put_contents, filesize, implode, is_writable, sprintf, strtolower, unlink, }; use crate::advisory::Auditor; @@ -396,8 +395,6 @@ impl RequireCommand { } else { "it is" }; - // TODO(phase-b): PHP's array_merge_recursive + array_unique on a list of - // string lists; collapsed here to a flat unique Vec<String>. let merged: Vec<String> = dev_packages.iter().flatten().cloned().collect(); let pkg_dev_tags: Vec<String> = array_unique(&merged); let warn_msg = format!( |
