diff --git a/doc/07-runtime.md b/doc/07-runtime.md index ab90a57b3..933897732 100644 --- a/doc/07-runtime.md +++ b/doc/07-runtime.md @@ -31,7 +31,7 @@ Note that this can not be used to check whether platform packages are installed. ### Knowing whether package X is installed in version Y -> **Note:** To use this, your package must require `"composer/semver": "^2.0"`. +> **Note:** To use this, your package must require `"composer/semver": "^3.0"`. ```php use Composer\Semver\VersionParser; diff --git a/src/Composer/InstalledVersions.php b/src/Composer/InstalledVersions.php index eb8ea3763..b272573d9 100644 --- a/src/Composer/InstalledVersions.php +++ b/src/Composer/InstalledVersions.php @@ -18,6 +18,8 @@ use Composer\Semver\VersionParser; /** * This class is copied in every Composer installed project and available to all * + * See also https://getcomposer.org/doc/07-runtime.md#installed-versions + * * To require it's presence, you can require `composer-runtime-api ^2.0` */ class InstalledVersions @@ -200,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: list} + * @psalm-return array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[]}, versions: array} */ public static function getRawData() { @@ -223,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: list} $data + * @psalm-param array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[]}, versions: array} $data */ public static function reload($data) { @@ -233,6 +235,7 @@ class InstalledVersions /** * @return array[] + * @psalm-return list}> */ private static function getInstalled() {