diff --git a/src/Composer/InstalledVersions.php b/src/Composer/InstalledVersions.php index 5126c5f8b..8384c86f8 100644 --- a/src/Composer/InstalledVersions.php +++ b/src/Composer/InstalledVersions.php @@ -88,7 +88,7 @@ class InstalledVersions { foreach (self::getInstalled() as $installed) { 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. * @return array[] - * @psalm-return array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool}, versions: array} + * @psalm-return array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool}, versions: array} */ public static function getRawData() { @@ -266,7 +266,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[], dev: bool}, versions: array} $data + * @psalm-param array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool}, versions: array} $data */ public static function reload($data) { @@ -276,7 +276,7 @@ class InstalledVersions /** * @return array[] - * @psalm-return list}> + * @psalm-return list}> */ private static function getInstalled() { diff --git a/src/Composer/Repository/FilesystemRepository.php b/src/Composer/Repository/FilesystemRepository.php index 99af09be7..bf2440bc8 100644 --- a/src/Composer/Repository/FilesystemRepository.php +++ b/src/Composer/Repository/FilesystemRepository.php @@ -222,11 +222,11 @@ class FilesystemRepository extends WritableArrayRepository 'install_path' => $installPath, 'aliases' => array(), 'reference' => $reference, - 'dev-requirement' => isset($devPackages[$package->getName()]), + 'dev_requirement' => isset($devPackages[$package->getName()]), ); if ($package instanceof RootPackageInterface) { $versions['root'] = $versions['versions'][$package->getName()]; - unset($versions['root']['dev-requirement']); + unset($versions['root']['dev_requirement']); $versions['root']['name'] = $package->getName(); $versions['root']['dev'] = $devMode; } @@ -240,10 +240,10 @@ class FilesystemRepository extends WritableArrayRepository if (PlatformRepository::isPlatformPackage($replace->getTarget())) { continue; } - if (!isset($versions['versions'][$replace->getTarget()]['dev-requirement'])) { - $versions['versions'][$replace->getTarget()]['dev-requirement'] = $isDevPackage; + if (!isset($versions['versions'][$replace->getTarget()]['dev_requirement'])) { + $versions['versions'][$replace->getTarget()]['dev_requirement'] = $isDevPackage; } elseif (!$isDevPackage) { - $versions['versions'][$replace->getTarget()]['dev-requirement'] = false; + $versions['versions'][$replace->getTarget()]['dev_requirement'] = false; } $replaced = $replace->getPrettyConstraint(); if ($replaced === 'self.version') { @@ -258,10 +258,10 @@ class FilesystemRepository extends WritableArrayRepository if (PlatformRepository::isPlatformPackage($provide->getTarget())) { continue; } - if (!isset($versions['versions'][$provide->getTarget()]['dev-requirement'])) { - $versions['versions'][$provide->getTarget()]['dev-requirement'] = $isDevPackage; + if (!isset($versions['versions'][$provide->getTarget()]['dev_requirement'])) { + $versions['versions'][$provide->getTarget()]['dev_requirement'] = $isDevPackage; } elseif (!$isDevPackage) { - $versions['versions'][$provide->getTarget()]['dev-requirement'] = false; + $versions['versions'][$provide->getTarget()]['dev_requirement'] = false; } $provided = $provide->getPrettyConstraint(); if ($provided === 'self.version') {