Skip to content

Commit

Permalink
Fix issue with php-metrics that also preloads Php-Parser
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrejmirtes committed May 4, 2020
1 parent 34edb50 commit a1d3990
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions bin/phpstan
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ use PHPStan\Command\WorkerCommand;

define('__PHPSTAN_RUNNING__', true);

$devOrPharLoader = require_once __DIR__ . '/../vendor/autoload.php';
require_once __DIR__ . '/../preload.php';
$devOrPharLoader->unregister();

$autoloaderInWorkingDirectory = getcwd() . '/vendor/autoload.php';
$composerAutoloaderProjectPaths = [];
if (is_file($autoloaderInWorkingDirectory)) {
Expand Down Expand Up @@ -50,16 +54,11 @@ use PHPStan\Command\WorkerCommand;

$autoloadProjectAutoloaderFile('/../../autoload.php');

$devOrPharAutoloadFile = __DIR__ . '/../vendor/autoload.php';
if (is_file($devOrPharAutoloadFile)) {
//$composerAutoloaderProjectPaths[] = dirname($devOrPharAutoloadFile, 2);
require_once $devOrPharAutoloadFile;
}
$devOrPharLoader->register(true);

require_once __DIR__ . '/../vendor/jetbrains/phpstorm-stubs/PhpStormStubsMap.php';
require_once __DIR__ . '/../vendor/react/promise-timer/src/functions_include.php';
require_once __DIR__ . '/../vendor/react/promise/src/functions_include.php';
require_once __DIR__ . '/../preload.php';

$version = 'Version unknown';
try {
Expand Down

0 comments on commit a1d3990

Please sign in to comment.