'unknown', self::PHP_PARSER_PACKAGE => 'unknown']; } /** @return _VersionData|null */ private static function loadPharVersions(): ?array { if (!class_exists(Phar::class)) { return null; } $phar_filename = Phar::running(true); if (!$phar_filename) { return null; } /** * @psalm-suppress UnresolvableInclude * @var _VersionData */ return require($phar_filename . '/phar-versions.php'); } /** @return _VersionData|null */ private static function loadComposerVersions(): ?array { try { return [ self::PSALM_PACKAGE => self::getVersion(self::PSALM_PACKAGE), self::PHP_PARSER_PACKAGE => self::getVersion(self::PHP_PARSER_PACKAGE), ]; } catch (OutOfBoundsException $ex) { } return null; } private static function getVersion(string $packageName): string { return InstalledVersions::getPrettyVersion($packageName) . '@' . InstalledVersions::getReference($packageName); } }