$ php rector.phar process /Users/tfidry/Project/Humbug/infection/src/Config/Exception/InvalidConfigException.php --dry-run --set=dead-classes -vvv
rector.yaml
parameters:
paths:
- 'src'
- 'tests'
exclude_rectors:
- 'Rector\CodeQuality\Rector\If_\SimplifyIfReturnBoolRector'
autoload_paths:
- 'vendor/autoload.php'
exclude_paths:
- 'tests/e2e/**/*'
Current behaviour
Rector 0.6.x-dev@262e8d8
Config file: rector.yaml
[parsing] src/Config/Exception/InvalidConfigException.php
PHP Fatal error: Uncaught Error: Class '_HumbugBox60f4f031e4cc\JetBrains\PHPStormStub\PhpStormStubsMap' not found in phar:///path/to/infection/rector.phar/vendor/ondrejmirtes/better-reflection/src/SourceLocator/SourceStubber/PhpStormStubsSourceStubber.php:67
Stack trace:
#0 phar:///path/to/infection/rector.phar/vendor/ondrejmirtes/better-reflection/src/SourceLocator/Type/PhpInternalSourceLocator.php(38): _HumbugBox60f4f031e4cc\Roave\BetterReflection\SourceLocator\SourceStubber\PhpStormStubsSourceStubber->generateClassStub('self')
#1 phar:///path/to/infection/rector.phar/vendor/ondrejmirtes/better-reflection/src/SourceLocator/Type/PhpInternalSourceLocator.php(31): _HumbugBox60f4f031e4cc\Roave\BetterReflection\SourceLocator\Type\PhpInternalSourceLocator->getClassSource(Object(_HumbugBox60f4f031e4cc\Roave\BetterReflection\Identifier\Identifier))
#2 phar:///path/to/infection/rector.phar/vendor/ondrejmirtes/better-reflection/src/SourceLocator/Type/Abst in phar:///path/to/infection/rector.phar/vendor/ondrejmirtes/better-reflection/src/SourceLocator/SourceStubber/PhpStormStubsSourceStubber.php on line 67
Fatal error: Uncaught Error: Class '_HumbugBox60f4f031e4cc\JetBrains\PHPStormStub\PhpStormStubsMap' not found in phar:///path/to/infection/rector.phar/vendor/ondrejmirtes/better-reflection/src/SourceLocator/SourceStubber/PhpStormStubsSourceStubber.php:67
Stack trace:
#0 phar:///path/to/infection/rector.phar/vendor/ondrejmirtes/better-reflection/src/SourceLocator/Type/PhpInternalSourceLocator.php(38): _HumbugBox60f4f031e4cc\Roave\BetterReflection\SourceLocator\SourceStubber\PhpStormStubsSourceStubber->generateClassStub('self')
#1 phar:///path/to/infection/rector.phar/vendor/ondrejmirtes/better-reflection/src/SourceLocator/Type/PhpInternalSourceLocator.php(31): _HumbugBox60f4f031e4cc\Roave\BetterReflection\SourceLocator\Type\PhpInternalSourceLocator->getClassSource(Object(_HumbugBox60f4f031e4cc\Roave\BetterReflection\Identifier\Identifier))
#2 phar:///path/to/infection/rector.phar/vendor/ondrejmirtes/better-reflection/src/SourceLocator/Type/Abst in phar:///path/to/infection/rector.phar/vendor/ondrejmirtes/better-reflection/src/SourceLocator/SourceStubber/PhpStormStubsSourceStubber.php on line 67
That’s currently fixed in PHPStan’s dev-master. I should release a bugfix version.
Just released 😃 https://github.com/phpstan/phpstan/releases/tag/0.12.10
I’ll look into fixing this properly after the weekend.
Yes, you’re right, I understand why. Try to manually include the file like this (https://github.com/phpstan/phpstan-src/blob/63707915d487f032574bf76d5cb25d42b73909b0/bin/phpstan#L58) in your tests bootstrap before I fix this in PHPStan itself. Thanks.