ignore stubs on composer install to prevent PHPStorm autocomplete break-down

This commit is contained in:
TomasVotruba 2019-12-04 22:33:58 +01:00
parent 2c22f48321
commit dbac28077c
2 changed files with 7 additions and 0 deletions

1
.gitattributes vendored
View File

@ -29,3 +29,4 @@ phpstan.neon export-ignore
phpunit.xml export-ignore
rector.yaml export-ignore
utils export-ignore
stubs export-ignore

View File

@ -25,6 +25,12 @@ final class StubLoader
$stubDirectory = __DIR__ . '/../../stubs';
// stubs might not exists on composer install, to prevent PHPStorm duplicated confusion
// @see https://github.com/rectorphp/rector/issues/1899
if (! file_exists($stubDirectory)) {
return;
}
$robotLoader = new RobotLoader();
$robotLoader->addDirectory($stubDirectory);
$robotLoader->setTempDirectory(sys_get_temp_dir() . '/_rector_stubs');