Skip to content

Commit

Permalink
Revert "Merge pull request vimeo#7239 from DeyV/master"
Browse files Browse the repository at this point in the history
This reverts commit 33628ca, reversing
changes made to 216cf6c.
  • Loading branch information
weirdan committed Jan 8, 2022
1 parent 760badd commit a4878ac
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 28 deletions.
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

0 comments on commit a4878ac

Please sign in to comment.