Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Merge pull request #7239 from DeyV/master" #7346

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions composer.json
Expand Up @@ -22,9 +22,9 @@
"ext-libxml": "*",
"ext-mbstring": "*",
"ext-tokenizer": "*",
"composer-runtime-api": "^2.0.0",
"amphp/amp": "^2.4.2",
"amphp/byte-stream": "^1.5",
"composer/package-versions-deprecated": "^1.8.0",
"composer/semver": "^1.4 || ^2.0 || ^3.0",
"composer/xdebug-handler": "^1.1 || ^2.0 || ^3.0",
"dnoegel/php-xdg-base-dir": "^0.1.1",
Expand All @@ -49,7 +49,7 @@
"phpmyadmin/sql-parser": "5.1.0||dev-master",
"phpspec/prophecy": ">=1.9.0",
"phpunit/phpunit": "^9.0",
"psalm/plugin-phpunit": "^0.16.1",
"psalm/plugin-phpunit": "^0.16",
"slevomat/coding-standard": "^7.0",
"squizlabs/php_codesniffer": "^3.5",
"symfony/process": "^4.3 || ^5.0 || ^6.0",
Expand Down
1 change: 1 addition & 0 deletions psalm.xml.dist
Expand Up @@ -58,6 +58,7 @@
</DeprecatedMethod>
<DeprecatedClass>
<errorLevel type="suppress">
<referencedClass name="PackageVersions\Versions"/>
<referencedClass name="Psalm\Plugin\Hook\*" />
</errorLevel>
</DeprecatedClass>
Expand Down
7 changes: 0 additions & 7 deletions scoper.inc.php
Expand Up @@ -27,13 +27,6 @@ function ($filePath, $prefix, $contents) {
$contents
);
},
function ($filePath, $prefix, $contents) {
return str_replace(
'\\'.$prefix.'\Composer\InstalledVersions',
'\Composer\InstalledVersions',
$contents
);
},
function ($filePath, $prefix, $contents) {
if (strpos($filePath, 'src/Psalm') === 0) {
return str_replace(
Expand Down
11 changes: 2 additions & 9 deletions src/Psalm/Internal/Cli/Plugin.php
Expand Up @@ -2,8 +2,7 @@

namespace Psalm\Internal\Cli;

use Composer\InstalledVersions;
use OutOfBoundsException;
use PackageVersions\Versions;
use Psalm\Internal\CliUtils;
use Psalm\Internal\PluginManager\Command\DisableCommand;
use Psalm\Internal\PluginManager\Command\EnableCommand;
Expand All @@ -30,13 +29,7 @@ public static function run(): void
$vendor_dir = CliUtils::getVendorDir($current_dir);
CliUtils::requireAutoloaders($current_dir, false, $vendor_dir);

$version = null;
try {
$version = InstalledVersions::getVersion('vimeo/psalm') ;
} catch (OutOfBoundsException $e) {
}

$app = new Application('psalm-plugin', $version ?? 'UNKNOWN');
$app = new Application('psalm-plugin', Versions::getVersion('vimeo/psalm'));

$psalm_root = dirname(__DIR__, 4) . DIRECTORY_SEPARATOR;

Expand Down
14 changes: 4 additions & 10 deletions src/Psalm/Internal/CliUtils.php
Expand Up @@ -3,14 +3,14 @@
namespace Psalm\Internal;

use Composer\Autoload\ClassLoader;
use Composer\InstalledVersions;
use OutOfBoundsException;
use PackageVersions\Versions;
use Phar;
use Psalm\Config;
use Psalm\Config\Creator;
use Psalm\Exception\ConfigException;
use Psalm\Exception\ConfigNotFoundException;
use Psalm\Internal\Analyzer\ProjectAnalyzer;
use Psalm\Internal\Composer;
use Psalm\Report;

use function array_slice;
Expand Down Expand Up @@ -147,14 +147,8 @@ public static function requireAutoloaders(
exit(1);
}

$version = null;
try {
$version = InstalledVersions::getVersion('vimeo/psalm') ;
} catch (OutOfBoundsException $e) {
}

define('PSALM_VERSION', $version ?? 'UNKNOWN');
define('PHP_PARSER_VERSION', InstalledVersions::getVersion('nikic/php-parser'));
define('PSALM_VERSION', Versions::getVersion('vimeo/psalm'));
define('PHP_PARSER_VERSION', Versions::getVersion('nikic/php-parser'));

return $first_autoloader;
}
Expand Down