rector: Call to undefined function Symfony\Component\DependencyInjection\Loader\Configurator\service()
Bug Report
| Subject | Details |
|---|---|
| Rector version | rector/rector:latest |
| Installed as | dockerimage |
λ docker run -it --rm --entrypoint bash -v %CD%:/project rector/rector:latest
root@440c45a4a3fb:/project# cd legacy-app
root@440c45a4a3fb:/project/legacy-app# which rector
/rector/bin/rector
root@440c45a4a3fb:/project/legacy-app# rector process . --dry-run -vvvv
[ERROR] Call to undefined function Symfony\Component\DependencyInjection\Loader\Configurator\service()
root@440c45a4a3fb:/project/legacy-app# rector --version
[ERROR] Call to undefined function Symfony\Component\DependencyInjection\Loader\Configurator\service()
<?php
declare(strict_types=1);
use Rector\Core\Configuration\Option;
use Rector\Php74\Rector\Property\TypedPropertyRector;
use Rector\Set\ValueObject\SetList;
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
return static function (ContainerConfigurator $containerConfigurator): void {
// get parameters
$parameters = $containerConfigurator->parameters();
// Define what rule sets will be applied
$parameters->set(Option::SETS, [
'php72',
]);
// get services (needed for register a single rule)
// $services = $containerConfigurator->services();
// register a single rule
// $services->set(TypedPropertyRector::class);
};
Minimal PHP Code Causing Issue
No idea where to start the debug. It seems that rector does not output stacktrace for its exceptions even with -vvv
Expected Behaviour
This does not happen 😃
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 17 (16 by maintainers)
Tried it, I guess the 7.1 version would need to be scoped as well to work 😢
Although for reasons yet unknown it breaks on symfony iself:
IMHO scoping + docker is a way to go. There would be no conflicts whatsoever.
Oh, I forgot about that 😕 @leoloso Could you incorporate that into the build process? It’s not helpful without that.
Intention was to use it to migrate from 7.1.30 to something of late 😃 It’s why I went with docker in the first place.