1
0
Fork 0

Rename dev-requirement to dev_requirement for consistency

pull/9699/head
Jordi Boggiano 2021-05-21 13:17:47 +02:00
parent b6c9d34125
commit 8335b49cf0
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC
2 changed files with 12 additions and 12 deletions

View File

@ -88,7 +88,7 @@ class InstalledVersions
{ {
foreach (self::getInstalled() as $installed) { foreach (self::getInstalled() as $installed) {
if (isset($installed['versions'][$packageName])) { if (isset($installed['versions'][$packageName])) {
return $includeDevRequirements || empty($installed['versions'][$packageName]['dev-requirement']); return $includeDevRequirements || empty($installed['versions'][$packageName]['dev_requirement']);
} }
} }
@ -230,7 +230,7 @@ class InstalledVersions
* *
* @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect. * @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect.
* @return array[] * @return array[]
* @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[]}>} * @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() public static function getRawData()
{ {
@ -266,7 +266,7 @@ class InstalledVersions
* @param array[] $data A vendor/composer/installed.php data set * @param array[] $data A vendor/composer/installed.php data set
* @return void * @return void
* *
* @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 * @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) public static function reload($data)
{ {
@ -276,7 +276,7 @@ class InstalledVersions
/** /**
* @return array[] * @return array[]
* @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[]}>}> * @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() private static function getInstalled()
{ {

View File

@ -222,11 +222,11 @@ class FilesystemRepository extends WritableArrayRepository
'install_path' => $installPath, 'install_path' => $installPath,
'aliases' => array(), 'aliases' => array(),
'reference' => $reference, 'reference' => $reference,
'dev-requirement' => isset($devPackages[$package->getName()]), 'dev_requirement' => isset($devPackages[$package->getName()]),
); );
if ($package instanceof RootPackageInterface) { if ($package instanceof RootPackageInterface) {
$versions['root'] = $versions['versions'][$package->getName()]; $versions['root'] = $versions['versions'][$package->getName()];
unset($versions['root']['dev-requirement']); unset($versions['root']['dev_requirement']);
$versions['root']['name'] = $package->getName(); $versions['root']['name'] = $package->getName();
$versions['root']['dev'] = $devMode; $versions['root']['dev'] = $devMode;
} }
@ -240,10 +240,10 @@ class FilesystemRepository extends WritableArrayRepository
if (PlatformRepository::isPlatformPackage($replace->getTarget())) { if (PlatformRepository::isPlatformPackage($replace->getTarget())) {
continue; continue;
} }
if (!isset($versions['versions'][$replace->getTarget()]['dev-requirement'])) { if (!isset($versions['versions'][$replace->getTarget()]['dev_requirement'])) {
$versions['versions'][$replace->getTarget()]['dev-requirement'] = $isDevPackage; $versions['versions'][$replace->getTarget()]['dev_requirement'] = $isDevPackage;
} elseif (!$isDevPackage) { } elseif (!$isDevPackage) {
$versions['versions'][$replace->getTarget()]['dev-requirement'] = false; $versions['versions'][$replace->getTarget()]['dev_requirement'] = false;
} }
$replaced = $replace->getPrettyConstraint(); $replaced = $replace->getPrettyConstraint();
if ($replaced === 'self.version') { if ($replaced === 'self.version') {
@ -258,10 +258,10 @@ class FilesystemRepository extends WritableArrayRepository
if (PlatformRepository::isPlatformPackage($provide->getTarget())) { if (PlatformRepository::isPlatformPackage($provide->getTarget())) {
continue; continue;
} }
if (!isset($versions['versions'][$provide->getTarget()]['dev-requirement'])) { if (!isset($versions['versions'][$provide->getTarget()]['dev_requirement'])) {
$versions['versions'][$provide->getTarget()]['dev-requirement'] = $isDevPackage; $versions['versions'][$provide->getTarget()]['dev_requirement'] = $isDevPackage;
} elseif (!$isDevPackage) { } elseif (!$isDevPackage) {
$versions['versions'][$provide->getTarget()]['dev-requirement'] = false; $versions['versions'][$provide->getTarget()]['dev_requirement'] = false;
} }
$provided = $provide->getPrettyConstraint(); $provided = $provide->getPrettyConstraint();
if ($provided === 'self.version') { if ($provided === 'self.version') {