Skip to content

Commit 3bb6952

Browse files
authored
Merge branch refs/heads/1.11.x into 1.12.x
2 parents 1f98927 + 2cc6cda commit 3bb6952

File tree

1 file changed

+14
-22
lines changed

1 file changed

+14
-22
lines changed

bin/phpstan

Lines changed: 14 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -92,38 +92,30 @@ use Symfony\Component\Console\Helper\ProgressBar;
9292
require_once $autoloaderInWorkingDirectory;
9393
}
9494

95-
$autoloadProjectAutoloaderFile = function (string $file) use (&$composerAutoloaderProjectPaths): void {
96-
$path = realpath(dirname(__DIR__) . $file);
97-
if ($path === false) {
98-
return;
99-
}
95+
$path = dirname(__DIR__, 3) . '/autoload.php';
96+
if (!extension_loaded('phar')) {
97+
if (@is_file($path)) {
98+
$composerAutoloaderProjectPaths[] = dirname($path, 2);
10099

101-
if (!extension_loaded('phar')) {
100+
require_once $path;
101+
}
102+
} else {
103+
$pharPath = \Phar::running(false);
104+
if ($pharPath === '') {
102105
if (@is_file($path)) {
103106
$composerAutoloaderProjectPaths[] = dirname($path, 2);
104107

105108
require_once $path;
106109
}
107110
} else {
108-
$pharPath = \Phar::running(false);
109-
if ($pharPath === '') {
110-
if (@is_file($path)) {
111-
$composerAutoloaderProjectPaths[] = dirname($path, 2);
112-
113-
require_once $path;
114-
}
115-
} else {
116-
$path = realpath(dirname($pharPath) . $file);
117-
if ($path !== false && @is_file($path)) {
118-
$composerAutoloaderProjectPaths[] = dirname($path, 2);
111+
$path = dirname($pharPath, 3) . '/autoload.php';
112+
if (@is_file($path)) {
113+
$composerAutoloaderProjectPaths[] = dirname($path, 2);
119114

120-
require_once $path;
121-
}
115+
require_once $path;
122116
}
123117
}
124-
};
125-
126-
$autoloadProjectAutoloaderFile('/../../autoload.php');
118+
}
127119

128120
/** @var array<callable>|false $autoloadFunctionsAfter */
129121
$autoloadFunctionsAfter = spl_autoload_functions();

0 commit comments

Comments
 (0)