You are here

private function LocalPackagesTrait::getPackagesFromLockFile in Automatic Updates 8.2

Reads all package information from a composer.lock file.

Parameters

string $dir: The directory which contains the lock file.

Return value

mixed[][] All package information (including dev packages) from the lock file.

1 call to LocalPackagesTrait::getPackagesFromLockFile()
LocalPackagesTrait::getLocalPackageRepositories in tests/src/Traits/LocalPackagesTrait.php
Generates local path repositories for a set of installed packages.

File

tests/src/Traits/LocalPackagesTrait.php, line 158

Class

LocalPackagesTrait
Provides methods for interacting with installed Composer packages.

Namespace

Drupal\Tests\automatic_updates\Traits

Code

private function getPackagesFromLockFile(string $dir) : array {
  $lock = $this
    ->readJson($dir . DIRECTORY_SEPARATOR . 'composer.lock');
  return array_merge($lock['packages'], $lock['packages-dev']);
}