Skip to main content

Module root

Module root 

Source
Expand description

The root package as RootPackageLoader::load builds it (docs/reference/RootPackageLoader.php): version (composer.json, COMPOSER_ROOT_VERSION, git, otherwise 1.0.0+no-version-set), links, minimum-stability, prefer-stable, and the three extractions from the require constraints: aliases (X as Y), stability flags (@dev, branches), references (#sha).

Structs§

RootAlias
RootPackage::getAliases(): an alias declared in a require.
RootError
RootPackage
RootPatch
What a dry run changes on the root package in memory instead of in composer.json.

Constants§

DEFAULT_PRETTY_VERSION

Functions§

extract_references
RootPackageLoader::extractReferences.
extract_stability_flags
RootPackageLoader::extractStabilityFlags.
manifest_error
VersionParser::normalizeStability. The refusals RootPackageLoader::load raises from the manifest alone, in its order: the root package’s own name, then — after the links are parsed, which changes nothing for a raw manifest — a package that requires itself, then the name of every link of the five BasePackage::$supportedLinkTypes.
merge_plugin_stability_flags
composer-merge-plugin’s ExtraPackage::mergeStabilityFlags for one merged file: StabilityFlags::extractAll over the file’s own requirements (an explicit @flag, the most unstable across the constraint’s parts, else the parsed stability when it is dev and not more stable than the minimum), each raised to at least the root’s current flag, then array_merged over the root’s flags.
normalize_stability
root_constraint
Constraint of a root require (with as: the source part).
undetected_version_warning
The warning RootPackageLoader::load writes when it gives the root package the default version (RootPackageLoader.php:91-117): no version key in composer.json (a null one is refused by Composer’s schema before load, and by load_with_version here), no COMPOSER_ROOT_VERSION (PHP-truthy), and nothing guessVersion can read from git — unless the root has no name (__root__) or is of type project. A name with a naming error throws before the version is looked at (:85-89): no warning then. Composer writes it through IOInterface::warning, a NORMAL line on stderr, each time it creates the command’s Composer instance.