Skip to content
PHP Ecosystem
Explore

PackageUtil

API reference › Foxy › Util › PackageUtil

final classFoxy\Util\PackageUtil
Sourcesrc/Util/PackageUtil.php

Hydrates Composer package records stored in lock data.

MethodDescriptionDefined by
loadLockPackage() staticLoad the packages in the packages section of the locker load data.PackageUtil
loadLockPackages() staticLoads the packages and packages-dev entries of the lock data, leaving every other key unchanged.PackageUtil
public static function loadLockPackage(Composer\Package\Loader\ArrayLoader $loader, array $lockData, bool $dev = false): array

Load the packages in the packages section of the locker load data.

Parameters

ParameterTypeDescription
$loaderComposer\Package\Loader\ArrayLoaderThe package loader of composer.
$lockDataarrayThe lock data of locker.
$devboolCheck if the dev packages must be loaded.

Returns

array: The lock data

public static function loadLockPackages(array $lockData): array

Loads the packages and packages-dev entries of the lock data, leaving every other key unchanged.

Parameters

ParameterTypeDescription
$lockDataarrayThe raw lock data, as read from the lock file.

Returns

array: The lock data with package entries replaced by package instances.