Skip to content

Commit

Permalink
Merge pull request #7337 from orklah/broken-phar
Browse files Browse the repository at this point in the history
replace class name by full FQN for scoper
  • Loading branch information
orklah committed Jan 7, 2022
2 parents daeb9ce + 90ada37 commit abd499c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
5 changes: 3 additions & 2 deletions src/Psalm/Internal/Cli/Plugin.php
Expand Up @@ -2,7 +2,6 @@

namespace Psalm\Internal\Cli;

use Composer\InstalledVersions;
use OutOfBoundsException;
use Psalm\Internal\CliUtils;
use Psalm\Internal\PluginManager\Command\DisableCommand;
Expand Down Expand Up @@ -32,7 +31,9 @@ public static function run(): void

$version = null;
try {
$version = InstalledVersions::getVersion('vimeo/psalm') ;
// we ignore the FQN because of a hack in scoper.inc that needs full path
// phpcs:ignore SlevomatCodingStandard.Namespaces.ReferenceUsedNamesOnly.ReferenceViaFullyQualifiedName
$version = \Composer\InstalledVersions::getVersion('vimeo/psalm') ;
} catch (OutOfBoundsException $e) {
}

Expand Down
9 changes: 6 additions & 3 deletions src/Psalm/Internal/CliUtils.php
Expand Up @@ -3,7 +3,6 @@
namespace Psalm\Internal;

use Composer\Autoload\ClassLoader;
use Composer\InstalledVersions;
use OutOfBoundsException;
use Phar;
use Psalm\Config;
Expand Down Expand Up @@ -149,12 +148,16 @@ public static function requireAutoloaders(

$version = null;
try {
$version = InstalledVersions::getVersion('vimeo/psalm') ;
// we ignore the FQN because of a hack in scoper.inc that needs full path
// phpcs:ignore SlevomatCodingStandard.Namespaces.ReferenceUsedNamesOnly.ReferenceViaFullyQualifiedName
$version = \Composer\InstalledVersions::getVersion('vimeo/psalm') ;
} catch (OutOfBoundsException $e) {
}

define('PSALM_VERSION', $version ?? 'UNKNOWN');
define('PHP_PARSER_VERSION', InstalledVersions::getVersion('nikic/php-parser'));
// we ignore the FQN because of a hack in scoper.inc that needs full path
// phpcs:ignore SlevomatCodingStandard.Namespaces.ReferenceUsedNamesOnly.ReferenceViaFullyQualifiedName
define('PHP_PARSER_VERSION', \Composer\InstalledVersions::getVersion('nikic/php-parser'));

return $first_autoloader;
}
Expand Down

0 comments on commit abd499c

Please sign in to comment.