Rector: Rector-prefix v0.7.19 is broken

Created on 25 Apr 2020  路  9Comments  路  Source: rectorphp/rector

Bug Report

Running
composer require rector/rector-prefixed

Using version ^0.7.19 for rector/rector-prefixed
./composer.json has been created
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 1 install, 0 updates, 0 removals
  - Installing rector/rector-prefixed (v0.7.19): Loading from cache
Writing lock file
Generating autoload files

Results in this error:

PHP Fatal error:  Uncaught _HumbugBox51a0a1cb71e7\Nette\InvalidArgumentException: Service 'betterReflectionSourceLocator': Class or interface 'Roave\BetterReflection\SourceLocator\Type\SourceLocator' not found. in phar:///Users/shaal/code/test/rector-prefixed-test/vendor/rector/rector-prefixed/rector/vendor/nette/di/src/DI/Definitions/Definition.php:52
Stack trace:
#0 phar:///Users/shaal/code/test/rector-prefixed-test/vendor/rector/rector-prefixed/rector/vendor/nette/di/src/DI/Definitions/ServiceDefinition.php(46): _HumbugBox51a0a1cb71e7\Nette\DI\Definitions\Definition->setType('Roave\\BetterRef...')
#1 phar:///Users/shaal/code/test/rector-prefixed-test/vendor/rector/rector-prefixed/rector/vendor/nette/di/src/DI/Extensions/ServicesExtension.php(67): _HumbugBox51a0a1cb71e7\Nette\DI\Definitions\ServiceDefinition->setType('Roave\\BetterRef...')
#2 phar:///Users/shaal/code/test/rector-prefixed-test/vendor/rector/rector-prefixed/rector/vendor/nette/di/src/DI/Extensions/ServicesExtension.php(51): _HumbugBox51a0a1cb71e7\Nette\DI\Exte in phar:///Users/shaal/code/test/rector-prefixed-test/vendor/rector/rector-prefixed/rector/vendor/nette/di/src/DI/Extensions/ServicesExtension.php on line 54
Fatal error: Uncaught _HumbugBox51a0a1cb71e7\Nette\InvalidArgumentException: Service 'betterReflectionSourceLocator': Class or interface 'Roave\BetterReflection\SourceLocator\Type\SourceLocator' not found. in phar:///Users/shaal/code/test/rector-prefixed-test/vendor/rector/rector-prefixed/rector/vendor/nette/di/src/DI/Definitions/Definition.php:52
Stack trace:
#0 phar:///Users/shaal/code/test/rector-prefixed-test/vendor/rector/rector-prefixed/rector/vendor/nette/di/src/DI/Definitions/ServiceDefinition.php(46): _HumbugBox51a0a1cb71e7\Nette\DI\Definitions\Definition->setType('Roave\\BetterRef...')
#1 phar:///Users/shaal/code/test/rector-prefixed-test/vendor/rector/rector-prefixed/rector/vendor/nette/di/src/DI/Extensions/ServicesExtension.php(67): _HumbugBox51a0a1cb71e7\Nette\DI\Definitions\ServiceDefinition->setType('Roave\\BetterRef...')
#2 phar:///Users/shaal/code/test/rector-prefixed-test/vendor/rector/rector-prefixed/rector/vendor/nette/di/src/DI/Extensions/ServicesExtension.php(51): _HumbugBox51a0a1cb71e7\Nette\DI\Exte in phar:///Users/shaal/code/test/rector-prefixed-test/vendor/rector/rector-prefixed/rector/vendor/nette/di/src/DI/Extensions/ServicesExtension.php on line 54

Related to: https://github.com/rectorphp/rector/pull/3255#issuecomment-619294496

bug prefixed

All 9 comments

Noticed. Something in compiler is broken, not sure what.

See Travis: https://travis-ci.org/github/rectorphp/rector/builds/679258755

I have the same issue with the last version

`PHP Fatal error: Uncaught _HumbugBox51a0a1cb71e7\Nette\InvalidArgumentException: Service 'betterReflectionSourceLocator': Class or interface 'Roave\BetterReflection\SourceLocator\Type\SourceLocator' not found. in phar:///home/homes/f.dey/apps/ugc-unlimited/vendor/rector/rector-prefixed/rector/vendor/nette/di/src/DI/Definitions/Definition.php:52
Stack trace:

0 phar:///home/homes/f.dey/apps/ugc-unlimited/vendor/rector/rector-prefixed/rector/vendor/nette/di/src/DI/Definitions/ServiceDefinition.php(46): _HumbugBox51a0a1cb71e7\Nette\DI\Definitions\Definition->setType('Roave\BetterRef...')

1 phar:///home/homes/f.dey/apps/ugc-unlimited/vendor/rector/rector-prefixed/rector/vendor/nette/di/src/DI/Extensions/ServicesExtension.php(67): _HumbugBox51a0a1cb71e7\Nette\DI\Definitions\ServiceDefinition->setType('Roave\BetterRef...')

2 phar:///home/homes/f.dey/apps/ugc-unlimited/vendor/rector/rector-prefixed/rector/vendor/nette/di/src/DI/Extensions/ServicesExtension.php(51): _HumbugBox51a0a1cb71e7\Nette\DI\Extensions\ServicesExtension->up in phar:///home/homes/f.dey/apps/ugc-unlimited/vendor/rector/rector-prefixed/rector/vendor/nette/di/src/DI/Extensions/ServicesExtension.php on line 54

Fatal error: Uncaught _HumbugBox51a0a1cb71e7\Nette\InvalidArgumentException: Service 'betterReflectionSourceLocator': Class or interface 'Roave\BetterReflection\SourceLocator\Type\SourceLocator' not found. in phar:///home/homes/f.dey/apps/ugc-unlimited/vendor/rector/rector-prefixed/rector/vendor/nette/di/src/DI/Definitions/Definition.php:52
Stack trace:

0 phar:///home/homes/f.dey/apps/ugc-unlimited/vendor/rector/rector-prefixed/rector/vendor/nette/di/src/DI/Definitions/ServiceDefinition.php(46): _HumbugBox51a0a1cb71e7\Nette\DI\Definitions\Definition->setType('Roave\BetterRef...')

1 phar:///home/homes/f.dey/apps/ugc-unlimited/vendor/rector/rector-prefixed/rector/vendor/nette/di/src/DI/Extensions/ServicesExtension.php(67): _HumbugBox51a0a1cb71e7\Nette\DI\Definitions\ServiceDefinition->setType('Roave\BetterRef...')

2 phar:///home/homes/f.dey/apps/ugc-unlimited/vendor/rector/rector-prefixed/rector/vendor/nette/di/src/DI/Extensions/ServicesExtension.php(51): _HumbugBox51a0a1cb71e7\Nette\DI\Extensions\ServicesExtension->up in phar:///home/homes/f.dey/apps/ugc-unlimited/vendor/rector/rector-prefixed/rector/vendor/nette/di/src/DI/Extensions/ServicesExtension.php on line 54`

Can you fix it please ?

Regards

Fabien

Rector has an updated released version 0.7.22 (same version number was released 12 days ago, but now it includes many more commits)

Rector-Prefixed has 0.7.22 from 12 days ago but no new commits since.

I finally discovered the regression, it was caused here: https://github.com/rectorphp/rector/issues/3227

This PR should fix it:
https://github.com/rectorphp/rector/pull/3387

Could you confirm the latest (1 hours ago) rector.phar works for you?

@TomasVotruba
thanks, it works now! (PHP 7.4.4)

@TomasVotruba it works! thank you for fixing that.
When you cut the next release of Rector, we'll be able to update to latest rector-prefixed package.

@TomasVotruba Do you know when will you release the new version of rector-prefixed ?

Not sure yet. I wait for Symfony 5.1 to release Symplify 8, then lock Rector to it. I think at the end of the May the latest.

Current phar is usable as dependency though, just lock it to the commit.

Closing as fixed and verified

Was this page helpful?
0 / 5 - 0 ratings