| Age | Commit message (Collapse) | Author |
|
Port Config::process() to the real Preg::replace_callback, whose closure
borrows &self/flags and calls get_with_flags; surface get() errors via a
captured cell so process now returns Result. Switch the replace_callback
shim bounds to FnMut to allow the error-capturing closure.
Wire CreateProjectCommand suggestion collection through the
Rc<RefCell> reporter's interior mutation.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
Align the Symfony namespace mapping with the documented convention
(symfony::component::X -> symfony::X) and remove now-unused console
stub files. Update all import paths across the workspace.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
Resolve category F phase-b TODOs (class-string, instanceof, get_class,
method_exists, __FILE__, Reflection API, downcast).
- VcsRepository: dispatch drivers through a VcsDriverKind enum
(instantiate/supports/php_class_name) and add constructors to the
concrete VCS drivers
- repository downcasts via RepositoryInterfaceHandle::downcast_rc and
as_any (init/show commands, vcs ValidatingArrayLoader)
- BaseCommand::is_self_update_command override replaces an instanceof
- Factory::create narrows PartialComposer to ComposerHandle via as_full
- InstalledVersions gains set_self_dir/set_installed_is_local_dir,
replacing Reflection-based static property mutation
- ClassLoader::as_array_iter ports the PHP (array) cast
- drop the unnecessary __FILE__ phar branch in self-update
application get_class(command) reclassified TODO(plugin); buffer_io
StreamableInputInterface downcast and the ValidatingArrayLoader trait
redesign left as tracked TODOs.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
Replace the 10 fallback-closure todo!()s in manipulate_json with real
PhpMixed manipulation. The fallback rewrites the decoded composer.json
when the JsonManipulator clean update fails.
- manipulate_json: drop the args Vec and array_unshift_ref (the latter
called the array_unshift shim and only existed to thread config through
args). Fallbacks now take &mut config directly and capture typed values,
mirroring the clean closures. fallback returns Result so insertRepository
can throw on a missing reference repository.
- Add private helpers: normalize_repositories_to_list,
dedupe_repositories_by_name, set_nested, unset_nested, is_auth_config_key.
- Faithfully mirror PHP quirks in the dormant fallback path, including the
reset()+foreach double-walk of the first segment in add/removeProperty.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
Replace the PHP `call_user_func([$obj, $method], ...)` / `$obj->{'get'.$x}()`
dynamic dispatches (category E) with static Rust dispatch.
- json_config_source: inject the clean-update as a typed
`FnOnce(&mut JsonManipulator) -> Result<bool>` closure instead of a
method-name string, dropping the call_user_func_array round-trip through
PhpMixed args. The auth-config method override moves into the
add/remove_config_setting closures.
- config_command: dispatch addConfigSetting/addProperty on the concrete
JsonConfigSource via match.
- locker: select getRequires/getDevRequires and getReplaces/getProvides via
match on the existing handle getters (previously stubbed to empty Vec).
- create_project_command: reuse the existing get_links_for_type helper.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
PHP mutator methods that the Phase B port could not call because only
&self / &dyn / Rc access was available. Resolved by the interior-mutation
APIs that already exist: handle &self setters (set_dist/source_reference,
set_requires/dev/references/stability_flags), Rc<RefCell<dyn InputInterface>>
.borrow_mut(), and get_installation_manager().borrow_mut() (build_package_map
passes an empty/canonical package list per upstream). composer.get_package()
returns &RootPackageInterfaceHandle, so the "&dyn" Phase B note was wrong.
factory's set_config_source/set_auth_config_source were already live code;
their stale TODOs are removed.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
Replace value-by-value signature workarounds with proper ownership:
- validate_json_schema: borrow JsonFile via ValidateJsonInput<&JsonFile>,
restoring the dropped local auth file validation call
- Auditor::audit / Solver::new / create_pool: pass cloned Rc handles and
share Pool via Rc<RefCell<Pool>>; create_pool now takes &mut Request
- MarkAlias{Installed,Uninstalled}Operation: hand over AliasPackageHandle
from the alias-confirmed branch
- dispatch_installer_event: clone the base Transaction (Rc-backed
contents) and enable the PRE_OPERATIONS_EXEC dispatch
- SuggestedPackagesReporter: share between command and installer via
Rc<RefCell<>> to mirror PHP reference semantics
PrePoolCreateEvent remains a TODO: it is plugin-only and would require a
speculative Rc migration of Request whose payload is never read today.
|
|
Resolve the resolvable subset of category A (shared ownership / non-cloneable
PHP class) TODOs by leaning on values that are already shared behind Rc/handle
wrappers, where cloning preserves PHP reference semantics:
- solver: call IgnoreListPlatformRequirementFilter::filter_constraint with a
cloned AnyConstraint (a Clone enum) and propagate the Result
- update_command: filter PlatformRepository out of the repository manager's
handles into a CompositeRepository (array_filter equivalent)
- package_discovery_trait: pass the real platform_requirement_filter (Rc clone)
instead of substituting ignore_nothing()
- installation_manager: pass the original full operation list (Vec<Rc<_>>
clone) as all_operations
- file_downloader: swap self.io to NullIO and restore via std::mem::replace
- auditor: reuse the PackageInterfaceHandle list across the advisory and
abandoned-package queries
- process_executor: drop the unused, lossy Clone impl
- config / array_repository: demote settled RefCell-design markers to comments
Remaining category A items (factory installer wiring, purge_packages handle
bridge, installer cache identity, reinstall flow, plugin command discovery)
stay as TODOs since correct resolution needs structural refactors.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
Implement MetadataMinifier::expand with the PHP list-of-arrays signature
(Vec<IndexMap>) and wire it into ComposerRepository so composer/2.0
minified package metadata is expanded, resolving the phase-b TODO.
minify() is left unported as it is not used in Composer itself.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
Add an Ignored variant to the advisory enum (renamed to AnySecurityAdvisory)
so the PHP three-class hierarchy PartialSecurityAdvisory -> SecurityAdvisory
-> IgnoredSecurityAdvisory maps one-to-one onto enum variants.
Replace the hard-coded auditor downcasts with as_security_advisory()
(PHP `instanceof SecurityAdvisory`, true for both full and ignored) and
as_ignored(), implementing severity/cve/source ignore filtering, the
toIgnoredAdvisory conversion, and the table/plain row output faithfully.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
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>
|
|
PHP shares a single PlatformRepository by reference across the RepositorySet,
createRequest, VersionSelector, and (in show) the installed repository. The
port worked with owned values / &mut, so it could not share: create_repository_set
silently dropped the platform repo from the pool (PlatformRepository is not
Clone), show rebuilt a fresh PlatformRepository per use, and the package
discovery / show version selectors were stubbed because VersionSelector wanted
an owned RepositorySet.
Thread the existing PlatformRepositoryHandle (Rc<RefCell<PlatformRepository>>)
through installer.rs and show, restoring the RootPackageRepository + platform
repo registration and implementing same_repository via RepositoryInterfaceHandle
ptr_eq. Hold package-discovery repos as a shared RepositoryInterfaceHandle, and
share RepositorySet as Rc<RefCell<RepositorySet>> in the set caches and
VersionSelector (which only reads it), unblocking both stubbed selector sites
and dropping show's placeholder set.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
Replace TODO(phase-b) placeholders (todo!() and commented-out code)
with real implementations:
- Share JsonFile via Rc<RefCell<JsonFile>> so JsonConfigSource and the
owning command can hold the same instance (base_config_command,
config_command, repository_command, require_command, create_project,
remove_command, factory)
- Change InstallerInterface methods (is_installed, download, prepare,
cleanup, get_install_path) to &mut self so initialize_vendor_dir can
run, propagated to all installer implementations
- Pass io/config/filesystem/process by clone instead of moving or
stubbing (auth_helper, svn_driver, curl_downloader, library_installer)
- Make TransportException Clone and store it by value in VcsRepository
- Clone operations in Transaction sort, root_aliases/temporary_constraints
in RepositorySet::create_pool, and share CompletePackage via handle in
PlatformRepository
- Wire up set_option, set_requires/set_dev_requires, installation manager
setters, BumpCommand::set_composer, and clean_backups/set_local_phar
|
|
The execute call was stubbed out during Phase B, so getVersion never
ran git --version and always reported no version. Wire it to
ProcessExecutor::execute_args.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
Reconcile the VcsDriverInterface trait with the concrete drivers so every
driver implements it as in PHP, where each driver extends VcsDriver.
- Make cache-mutating getters take &mut self in the trait, matching the
inherent methods' lazy-cache semantics; update vcs_repository consumers.
- Change supports() to take Rc<RefCell<Config>> and return Result<bool>,
completing GitDriver::supports deep ls-remote and its config wiring.
- Add base get_composer_information to Git/Hg/Fossil/Perforce and an
impl VcsDriverInterface block to every driver, delegating to inherent
methods and absorbing type differences in the impl.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
Add file_get_contents5 shim supporting use_include_path/context/offset/
length, and wire it into BinaryInstaller to read the first 500 bytes of
the bin file, replacing the offset-less stub and its phase-b TODO.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
Composer does not use its own deprecated APIs internally, so drop their
Rust ports: whole deprecated classes, methods, constants, and field.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
Replace the phase-b TODOs in DownloadManager::download with the actual
package.set_installation_source call, enabled by the interior mutability
of PackageInterfaceHandle. Drop the stale recursive-closure comments now
that the loop expresses the PHP $download($retry) flow.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
Resolve the phase-b TODO by passing composer.get_package() to
Locker::get_missing_requirement_info. The package is an Rc-backed
handle and the locker is borrowed from a separate Rc, so there is no
borrow conflict.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
Resolve the two phase-b borrow-conflict TODOs by cloning each Composer
subsystem handle out before borrowing, so the missing-dependency loop and
AutoloadGenerator::dump can hold their independent RefCell borrows.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
Replace the phase-b todo!() with the real ArchiveManager.archive
invocation by taking the manager via mutable borrow (borrow_mut for the
composer-owned RefCell, &mut for the locally created one). Also drop the
stale get_io clone_box TODOs in archive and search commands, reusing the
already-fetched io handle in search.
|
|
The OnceLock already emulates PHP's function-local `static $p4Executable;`
(compute once, cache for the process lifetime, shared across instances).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
Response only ever reads the url out of the request array, so accept it
as a String directly. With url always present the 'url key missing'
LogicException can no longer fire, so Response::new and CurlResponse::new
return Self instead of a double Result. Also drops the unused
from_php_mixed/to_php_mixed stubs and the request_to_map helper.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
RecursiveDirectoryIterator construction can throw UnexpectedValueException;
the shim now returns a Result so remove_directory_php can re-create the
iterator once after clearstatcache()/usleep, mirroring Composer's retry
for the spurious failures in composer/composer#4009.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
Implement the self-recursion in filterRequiredPackages so that
packages required transitively are collected, matching the PHP
source. BasePackageHandle is a type alias for PackageInterfaceHandle,
so no cast is needed.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
Implement the previously stubbed phase-b TODO so getSecurityAdvisories
skips advisories whose affected_versions do not match the requested
package constraint. Share the package VersionParser with
PartialSecurityAdvisory::create across both PackageRepository and
ComposerRepository instead of a separate semver parser instance.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
The repository type check was an internal invariant, not a recoverable
error condition. Replace the Result-returning validation with an
assert!, matching Composer's design where add_repository throws only on
a programming error, and drop the now-unneeded error handling at call
sites.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
Resolve the phase-b TODO by adding an as_writable_repository_interface_mut
downcast helper on RepositoryInterface, mirroring PHP's instanceof
WritableRepositoryInterface check, and propagate inner errors.
|
|
Convert InputInterface and OutputInterface parameters from &dyn/&mut dyn
references to Rc<RefCell<dyn ...>> shared ownership across the command,
console, and IO layers, matching the Phase C shared-ownership approach
already used for IOInterface.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
Mirror PHP's "new ArrayLoader($parser)" by passing the existing parser
instead of None. VersionParser is stateless, so behavior is unchanged;
this drops the phase-b TODO.
Co-Authored-By: Claude Opus 4.8 noreply@anthropic.com
|
|
The Phase B stub discarded the decoded PhpMixed and handed an empty
IndexMap to LoaderInterface::load, so nothing was actually loaded.
Unbox PhpMixed::Array into the map; mirror PHP's array $config type
juggling by raising a TypeError for non-array decode results.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
|
Move __toString ports to std::fmt::Display: convert Link's inherent
to_string() and make OperationInterface require Display instead of a
to_string() method, with each operation implementing Display.
Also fix the operation __toString output to use show(false), matching
SolverOperation::__toString() (was show(true)).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
|
Link is an immutable value object and is never compared by reference
identity, so cloning its fields is faithful to PHP. The shared-ownership
TODO does not apply.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
|
Resolve the phase-b TODO that left the supported-link-types loop as dead
code (links were always an empty Vec), so requires/conflicts/provides/
replaces/require-dev are dumped again via
PackageInterface::get_links_for_type, matching the PHP magic-call loop.
Every Link in production is constructed with a pretty constraint (all
ArrayLoader/AliasPackage/PlatformRepository/InstalledRepository sites
pass one), so make Link::pretty_constraint a required String instead of
Option<String>. get_pretty_constraint() now returns &str directly rather
than anyhow::Result<&str>, dropping the unreachable
UnexpectedValueException guard, and all call sites are updated.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
|
PHP BasePackage::equals uses === (reference identity), unwrapping
AliasPackage on both sides first. A plain &self / &dyn PackageInterface
cannot express this, so implement it on the shared handle where the
Rc-based identity infrastructure (as_alias, get_alias_of, ptr_eq)
already lives, and drop the unimplementable trait stub.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
|
Migrate ArchivableFilesFinder off Symfony's SplFileInfo onto Path/PathBuf,
resolving the phar_archiver TODO(phase-b) that required a .map() adapter to
bridge SplFileInfo -> PathBuf.
- ArchivableFilesFinder now yields PathBuf; accept() takes &Path; the exclude
closure receives &Path and uses Path::canonicalize / is_symlink. The
SplFileInfo -> PathBuf conversion happens once at the symfony get_iterator
boundary (get_iterator stays SplFileInfo for cache.rs).
- symfony Finder::filter callback changed to FnMut(&Path) (sole caller is the
finder).
- PharArchiver passes the finder straight into ArchivableFilesFilter, mirroring
PHP's new ArchivableFilesFilter($files).
- ZipArchiver consumes PathBuf items, computing the relative path via
strip_prefix(sources) in place of SplFileInfo::getRelativePathname.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
|
- Add Display for SplFileInfo (PHP (string) cast -> getPathname) and use it
in clean_backups instead of a debug-format placeholder.
- Generalize iterator_to_array's signature to preserve the element type so
get_last_backup_version collects real SplFileInfo and returns the last
basename, instead of mapping every entry to PhpMixed::Null.
- Drop the stale builder-restructure TODO in get_old_installation_finder.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
|
Add a Finder::filter(Box<dyn FnMut(&SplFileInfo) -> bool>) stub method and
route the exclude closure through it, matching PHP's ->in()->filter() chain.
FnMut faithfully represents PHP's stateful \Closure.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
|
The VcsDownloaderBase::clean_changes stub returned Ok(None), silently
swallowing the abort that PHP's parent::cleanChanges() raises when the
working copy has uncommitted changes. Drop the stub and give Git/Svn a
private fail_on_local_changes helper that performs the getLocalChanges
check and throws, matching the default VcsDownloader::clean_changes().
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
|
get_extension_problems
PHP's getExtensionProblems receives getReasons() directly; match that
instead of materializing an intermediate Vec<Vec<...>> with Rc clones.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
|
Resolve the phase-b stub by threading repository set, request and a
mutable pool into Rule::getPrettyString, mirroring PHP's default empty
installedMap/learnedPool arguments.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
|
mark_package_for_removal's LogicException can only fire on a bug since
both callers pre-filter irremovable packages, so port it as an assert!
rather than a recoverable Result. This unwinds the Result chain through
optimize and drops the pool_builder match that silently returned the
unoptimized pool on error, matching PHP's fatal-error propagation.
|
|
* Config::merge called array_merge_recursive where PHP uses plain
array_merge (string-key overwrite); switch those six sites to
array_merge.
* provides/replaces merges that may carry an AliasPackage's
self.version numeric keys ("0","1",...) were collapsing under naive
chain/insert/or_insert; route them through a new array_merge_map().
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
|
Mirror PHP's array_merge semantics in AliasPackage so self.version
provide/replace/conflict links are appended under numeric keys ("0",
"1", ...) instead of collapsing onto the target-name key. This keeps
both the original and alias-version links and makes Pool::match's
contains_key("0") check (= PHP isset($x[0])) work as intended.
replace_self_version_dependencies now takes and returns
IndexMap<String, Link>, dropping the lossy re-key-by-target in the
AliasPackage/RootAliasPackage constructors.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
|
Resolve TODO(phase-b) in LocalRepoTransaction.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
|
Resolve TODO(phase-b): mirror PHP's parent::__construct(true, $styles)
by extending the base OutputFormatter::new to accept a style map.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
|
LicensesCommand now renders the root package version via
get_full_pretty_version, matching PHP getFullPrettyVersion, and holds
the root package handle directly instead of snapshotting fields. Also
align update/mark-alias operations on get_full_pretty_version and remove
the now-stale phase-b TODO markers in status and licenses commands.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
|
initialize_repos now appends the local repository and remote
repositories from the repository manager after the root package repo,
matching PHP HomeCommand::initializeRepos.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
|
Register the selected binary as a Callable::String listener for the
__exec_command event, matching PHP ExecCommand's addListener call.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
|
Change RepositoryInterface and WritableRepositoryInterface read methods
(find_package, find_packages, get_packages, load_packages, search,
get_providers, get_canonical_packages) to take &mut self and return
anyhow::Result, so lazy-loading repositories such as ComposerRepository
can perform fallible I/O and mutate internal state on access. Update all
implementors and call sites to propagate the Result and pass mutable
references.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|