1
0
Fork 0

Fix stubs location

pull/224/head
Felix Becker 2016-12-20 13:53:15 +01:00
parent 710d2a7ff7
commit b93d4f33cb
1 changed files with 11 additions and 1 deletions

View File

@ -32,7 +32,17 @@ class ComposerScripts
$parser = new Parser;
$definitionResolver = new DefinitionResolver($index);
$stubsLocation = Path::canonicalize(__DIR__ . '/../vendor/JetBrains/phpstorm-stubs');
$stubsLocation = null;
foreach ([__DIR__ . '/../../../JetBrains/phpstorm-stubs', __DIR__ . '/../vendor/JetBrains/phpstorm-stubs'] as $dir) {
if (file_exists($dir)) {
$stubsLocation = Path::canonicalize($dir);
break;
}
}
if (!$stubsLocation) {
throw new \Exception('JetBrains/phpstorm-stubs package not found');
}
$uris = yield $finder->find("$stubsLocation/**/*.php");
foreach ($uris as $uri) {