| Age | Commit message (Collapse) | Author |
|
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>
|
|
All eight cases pass against NullIO's no-op IOInterfaceImmutable methods.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
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>
|
|
|
|
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>
|
|
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>
|
|
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
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>
|
|
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
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>
|
|
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>
|
|
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>
|
|
Make the Rust-only as_package_interface a required trait method and
return self from each concrete implementation, replacing the todo!()
default that PHP needs no equivalent for (implicit subtype coercion).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
|
|
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
Ported docblocks embed PHP usage examples as indented (and bare-fenced)
code blocks, which rustdoc compiled as Rust doctests and failed
`cargo test`. Mark them as `php` so they render as code without being
run.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
|
|
|
|
|
|
|
|
|
|
PHP's random_int/random_bytes are cryptographically secure, but Composer
does not rely on that property, so a non-cryptographic PRNG suffices.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|