aboutsummaryrefslogtreecommitdiffhomepage
AgeCommit message (Collapse)Author
2026-06-21test(advisory): port AuditConfigTestnsfisis
Config::merge reaches array_merge (a todo!() in the php-shim), so the cases that build a Config are #[ignore]. testMixedFormats additionally relies on integer-key handling that AuditConfig::parse_ignore_with_apply does not yet implement. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-21test(util-http): port RequestProxyTestnsfisis
Six cases pass against the implemented RequestProxy. The SSL-proxy case depends on curl_version (a todo!() in the php-shim) and is #[ignore]. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-21test(platform): port VersionTestnsfisis
Version::parse_openssl/parse_libjpeg/parse_zoneinfo_version rely on PCRE patterns that compile_php_pattern in the php-shim cannot yet parse, so the cases are #[ignore] while the test code compiles. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-21test(util): port ZipTestnsfisis
Zip::get_composer_json relies on ZipArchive, whose constructor is a todo!() in the php-shim, so all cases are #[ignore] while compiling. Reuses the existing PHP Fixtures/Zip archives. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-21test(util): port NoProxyPatternTestnsfisis
NoProxyPattern::test reaches a todo!() (substr_count) in the php-shim, so all cases are marked #[ignore] while the test code compiles. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-21style: apply rustfmt to ported test filesnsfisis
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-21test(dependency-resolver): port PoolTest with shared TestCase helpersnsfisis
Add tests/common/test_case.rs (get_package, get_version_constraint) ported from the PHP TestCase, included into the dependency_resolver binary via #[path]. PoolTest's testPool/testPackageById/testWhatProvidesWhenPackageCannotBeFound pass; testWhatProvidesPackageWithConstraint is #[ignore] (constraint matching reaches a todo!() in the php-shim). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-21test(package): port VersionBumperTestnsfisis
Marked #[ignore] because VersionBumper::bump_requirement uses a look-around regex pattern the regex crate cannot compile. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-21test(package): port CompletePackageTestnsfisis
All four cases pass: naming/versioning/marshalling semantics across the versioning-scheme provider, and target-dir normalization. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-21test(dependency-resolver): port RuleSetIteratorTestnsfisis
Both testForeach and testKeys pass. The PHP foreach over the Iterator is reproduced with the ported valid()/current()/key()/next() methods; the original assertEquals on rule objects is checked via Rc::ptr_eq since the iterator yields the same Rc instances. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-21test(util): port ConfigValidatorTestnsfisis
Reuses the existing PHP Fixtures composer_*.json. All four cases are marked #[ignore] because ConfigValidator::validate reaches a todo!() in the php-shim. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-21test(util): port UrlTestnsfisis
Both testUpdateDistReference and testSanitize are marked #[ignore] because the underlying regex patterns cannot be compiled by the regex crate. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-21test(io): port NullIOTestnsfisis
All eight cases pass against NullIO's no-op IOInterfaceImmutable methods. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-21test(util): port ProxyItemTestnsfisis
Both testThrowsOnMalformedUrl and testUrlFormatting are marked #[ignore] because ProxyItem::new reaches a todo!() in the php-shim. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-21test(dependency-resolver): port RequestTestnsfisis
Both cases pass. AnyConstraint has no PartialEq (foreign crate), so the assertEquals on the requires map is reproduced via Debug-representation comparison. The unused ArrayRepository setup from the original is omitted. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-21test(util): port TarTestnsfisis
All cases reuse the existing PHP fixtures under composer/tests/Composer/Test/Util/Fixtures/Tar. Marked #[ignore] because PharData::new is todo!() in the php-shim. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-21test(package): port VersionParserTestnsfisis
Both testParseNameVersionPairs (lookbehind/lookahead pattern unsupported by the regex crate) and testIsUpgrade (reaches a todo!() in the php-shim) are marked #[ignore]. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-21test: port ForgejoUrl, Silencer, PlatformRequirementFilterFactory testsnsfisis
Factory's instance-creation tests pass. ForgejoUrl (undelimited regex panic), Silencer (trigger_error/microtime todo!()), and the factory's unknown-type case (get_debug_type todo!()) are marked #[ignore]. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-21test: port BufferIO, Runtime, JsonValidationException testsnsfisis
JsonValidationExceptionTest passes. BufferIOTest (set_user_inputs is todo!()) and RuntimeTest (html_entity_decode is todo!()) are marked #[ignore]. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-21test: port small leaf tests (config, filters, platform, formatter)nsfisis
Port DefaultConfigTest, IgnoreAll/IgnoreNothingPlatformRequirementFilterTest, PlatformTest, GitExcludeFilterTest, and HtmlOutputFormatterTest. Each PHP Test/<Subdir>/ maps to a single integration-test binary via tests/<dir>/main.rs (the target is named after the directory) whose #[test] functions are collected from the module tree. Tests that exercise unported library behavior (regex backreferences, Preg::split, env expansion) are marked #[ignore]. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-21test: add empty test filesnsfisis
2026-06-20feat(symfony-process): port full Process class from PHPnsfisis
Faithfully port every method, field and constant of Symfony's Process.php into process.rs, replacing the reduced stub. Add the supporting pipes module (PipesInterface/AbstractPipes/UnixPipes/ WindowsPipes), ProcessUtils and the missing process exceptions (LogicException/InvalidArgumentException) with constructors. Methods now return anyhow::Result where PHP throws, take the env argument and a bool-returning callback, and borrow &mut for status-updating accessors; all callers are updated accordingly. Extend the php-shim with proc_open/proc_close (PHP-compatible signatures), proc_get_status, proc_terminate, posix_kill, uniqid, ftruncate, ftell_stream, fseek3, stream_get_contents3 and env helpers. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-20feat(ca-bundle): replace CaBundle todo!() with dummy implementationsnsfisis
CaBundle is slated for removal once HTTP handling moves to reqwest, which discovers the system CA bundle itself. Until then, fill the three methods with reasonable stand-ins: get_system_ca_root_bundle_path probes the SSL_CERT_FILE/SSL_CERT_DIR env vars and common distro CA locations, validate_ca_file requires a non-empty readable file, and is_openssl_parse_safe reports safe. The simplifications versus the original are noted with TODO(phase-c). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-20feat(php-shim): implement parse_url and filter_var URL/boolean filtersnsfisis
Back parse_url/parse_url_all with reqwest::Url and add the FILTER_VALIDATE_URL and FILTER_VALIDATE_BOOLEAN arms to filter_var, so Config::prohibit_url_by_config no longer hits todo!(). reqwest::Url is not a byte-for-byte port of PHP's parser; the divergences are noted with TODO(phase-c). Switch the scheme in_array in prohibit_url_by_config to strict: the needle is a string-or-null and the haystack holds only non-numeric string literals, so loose and strict comparison are provably equivalent here, avoiding a dependency on PHP loose `==` semantics. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-20test(cli): un-ignore no-longer-panicking command testsnsfisis
run-script, search, show, and update no longer panic; they exit with argument errors, which run_no_panic treats as success. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-20feat(outdated): proxy execute to show via shared Applicationnsfisis
The execute() proxy was left as todo!(); wire it to the shared Application handle so `outdated` re-enters the run flow as `show -l`, matching PHP's $this->getApplication()->run(). Add Application::shared() to expose the new_shared self-reference and un-ignore run_outdated. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-20feat(finder): implement Finder traversal and filter pipelinensfisis
Replace the todo!() stubs with an inline port of symfony/finder's searchInDirectory() pipeline, materializing entries as PathBuf in place of SplFileInfo. Also port Glob::toRegex, needed for glob name patterns. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-20fix(path): propagate PathBufnsfisis
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-20feat(clear-cache): implement ClearCacheCommand::executensfisis
Port the command body: resolve Config from tryComposer()'s composer or Factory::createConfig(), then clear or garbage-collect each cache-* path via Cache. try_composer is already implemented, so the prior blocker comment is stale. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-20feat(php-shim): implement is_writable via filesystem metadatansfisis
Replace the todo!() with a std-only check on the path's permission bits. A TODO notes this approximates PHP's access(2)/W_OK and can diverge for files the current user does not own; to be refined with a syscall crate. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-20feat(console): implement doRenderThrowable exception renderingnsfisis
Port Symfony's Application::doRenderThrowable so command failures render the error box instead of hitting todo!(). This unblocks six CLI no-panic tests (config, depends, global, prohibits, remove, repository), whose ignore attributes are now removed. Also fill in the php-shim functions on the render path that were still todo!(): php_exception_get_code, intval, str_pad, str_split, mb_detect_encoding, mb_convert_encoding, mb_strwidth, mb_convert_variables. PHP file/line and the verbose getTrace() block have no faithful Rust equivalent; file/line use PHP's own 'n/a' fallback and the trace block is intentionally omitted. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-20refactor(php-shim): drop Box wrapping from PhpMixed List/Arraynsfisis
The List and Array variants of PhpMixed boxed their elements unnecessarily. Store PhpMixed values directly and update all callers accordingly. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-20refactor(clippy): resolve idiomatic lint warningsnsfisis
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-20refactor(console): propagate getComposer's exit(1) as ExitExceptionnsfisis
Composer's Application::getComposer() calls exit(1) when a required Composer instance fails to build under areExceptionsCaught(). Replace the deep std::process::exit with a php-shim ExitException that mirrors PHP's `exit` construct: it bypasses parent::doRun()'s catch and Symfony's renderThrowable (excluded at both broad catches), so the already-written plain error message is not re-rendered and the process exits with code 1. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-20fix(comparer): return instead of exiting the process on doTree failurensfisis
Composer's doCompare() calls `exit;` when the destination doTree fails, but the source branch handles the identical failure with `return;`. The asymmetry has been present since the class was first written (2413b55c6, 2018) and is almost certainly a bug. Treat it as `return` so a failed local-change detection no longer terminates the whole process. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-20feat(php-shim): implement array_replace_recursivensfisis
Was a todo!() that panicked while building HTTP downloader options (browse, and the stream/remote filesystem option merging). Recurses only when both the existing and replacing value are arrays, merging assoc arrays by key and lists by index; otherwise the replacing value wins. Verified against PHP on a nested http/ssl option structure. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-20feat(php-shim): implement single-component pathinfonsfisis
Was a todo!() that panicked in Factory::get_lock_file (require, and the file/gzip downloaders). Handles the four PATHINFO_* single-component options by reusing dirname/basename, computing extension and filename around the last dot of the basename. Verified against PHP for eight representative paths, including dotfiles and trailing-dot names. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-20feat(php-shim): implement is_numericnsfisis
Was a todo!() that panicked when ProcessExecutor::reset_max_jobs probed COMPOSER_MAX_PARALLEL_PROCESSES (archive, diagnose, init, ...). Ints and floats are numeric; strings delegate to the existing is_numeric_string, which agrees with PHP across the tested vectors. Booleans, null and arrays are not numeric. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-20feat(php-shim): implement two-argument json_decodensfisis
Was a todo!() that panicked for every command reading composer.json (validate, status, show, update, ...). Parses via serde_json (built with preserve_order, so insertion order is kept) and converts to PhpMixed. Mirrors PHP's flagless json_decode: returns null rather than erroring on malformed input, and decodes objects to ArrayObject when assoc is false, to an associative array when true. Out-of-i64 and fractional numbers become floats, matching PHP's default non-bigint behaviour. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-20feat(php-shim): implement dirname()nsfisis
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-20fix(global-command): call base_run to stop run() infinite recursionnsfisis
GlobalCommand::run fell back to self.run when given fewer than two args, recursing forever and overflowing the stack. PHP calls parent::run there. Add Command::base_run holding the base run body so the override can delegate to it, matching PHP's parent::run. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-20test(cli): add more smoke testsnsfisis
2026-06-20refactor(installation-manager): cache installers by index, drop clone_boxnsfisis
InstallationManager::get_installer cached a per-type installer via a Rust-only `clone_box` stub (`todo!()`). PHP caches the SAME instance held in `$this->installers`. Store the index into `installers` instead, reproducing that sharing without cloning; both `add_installer` and `remove_installer` clear the cache, so indices never dangle. With the only caller gone, `InstallerInterface::clone_box` is removed. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-20refactor(plugin): return borrowed plugins from get_plugins, drop clone_boxnsfisis
PluginManager::get_plugins cloned each plugin through a Rust-only `clone_box` stub (`todo!()`). PHP's getPlugins() returns `$this->plugins` directly and the objects are shared by reference, so borrow the stored instances (`&[Box<dyn PluginInterface>]`) instead of cloning. The sole caller is adjusted and `PluginInterface::clone_box` is removed. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-20refactor(repository): remove unused functionnsfisis
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-20feat(io): implement IOInterface error/warning/debug loggingnsfisis
Resolve the 6 todo!() in ConsoleIO/NullIO by delegating the IOInterfaceImmutable logger methods to BaseIO. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-20feat(platform): implement Runtime::parse_html_extension_infonsfisis
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-20refactor(package-discovery): extend BaseCommand as supertraitnsfisis
PHP's PackageDiscoveryTrait is mixed into classes extending BaseCommand and calls its methods directly. Model that with a supertrait bound so get_io, try_composer, require_composer, get_platform_requirement_filter and normalize_requirements come from BaseCommand instead of being redeclared and delegated per command. Propagate the Result returns at the call sites and drop the now-redundant per-command impls. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-20feat(init): implement repos/repositorySets accessorsnsfisis
Add the repos and repositorySets fields backing PackageDiscoveryTrait, mirroring RequireCommand, and return them from get_repos_mut / get_repository_sets_mut. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-20feat(hg): implement Hg::new constructornsfisis
Take config and process as shared Rc<RefCell<..>> handles matching the struct fields and Util\Git's constructor, assigning them directly. PHP stores the same Config object reference, so sharing the Rc is faithful; update the three call sites to pass cloned handles. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>