1
0
Fork 0

Change root.dev-requirement to root.dev in installed.php as the root is not required per se, and this simply tracks the dev mode at install time

pull/9817/head
Jordi Boggiano 2021-04-07 13:27:20 +02:00
parent cb2db16637
commit 1179e4b481
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC
3 changed files with 7 additions and 6 deletions

View File

@ -189,7 +189,7 @@ class InstalledVersions
/**
* @return array
* @psalm-return array{name: string, version: string, reference: string, pretty_version: string, aliases: string[]}
* @psalm-return array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool}
*/
public static function getRootPackage()
{
@ -202,7 +202,7 @@ class InstalledVersions
* Returns the raw installed.php data for custom implementations
*
* @return array[]
* @psalm-return array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[]}, versions: array<string, array{pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[]}>}
* @psalm-return array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool}, versions: array<string, array{dev-requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[]}>}
*/
public static function getRawData()
{
@ -225,7 +225,7 @@ class InstalledVersions
* @param array[] $data A vendor/composer/installed.php data set
* @return void
*
* @psalm-param array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[]}, versions: array<string, array{pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[]}>} $data
* @psalm-param array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool}, versions: array<string, array{dev-requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[]}>} $data
*/
public static function reload($data)
{
@ -235,7 +235,7 @@ class InstalledVersions
/**
* @return array[]
* @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[]}, versions: array<string, array{pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[]}>}>
* @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool}, versions: array<string, array{dev-requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[]}>}>
*/
private static function getInstalled()
{

View File

@ -179,8 +179,9 @@ class FilesystemRepository extends WritableArrayRepository
);
if ($package instanceof RootPackageInterface) {
$versions['root'] = $versions['versions'][$package->getName()];
unset($versions['root']['dev-requirement']);
$versions['root']['name'] = $package->getName();
$versions['root']['dev-requirement'] = $devMode;
$versions['root']['dev'] = $devMode;
}
}

View File

@ -18,8 +18,8 @@ return array(
'1.10.x-dev',
),
'reference' => 'sourceref-by-default',
'dev-requirement' => true,
'name' => '__root__',
'dev' => true,
),
'versions' => array(
'__root__' => array(