Rector: Rector prefixed 0.8.56: Class 'Rector\Core\Console\Style\SymfonyStyleFactory' not found

Created on 30 Nov 2020  ·  10Comments  ·  Source: rectorphp/rector

Bug Report

| Subject | Details |
| :------------- | :---------------------------------------------------------------|
| Rector version | 0.8.56 |
| Installed as | prefixed Rector PHAR |

While trying to run a Rector with vendor/bin/rector there's an error happening:

❯ vendor/bin/rector
PHP Fatal error:  Uncaught Error: Class 'Rector\Core\Console\Style\SymfonyStyleFactory' not found in /Users/[...]/vendor/rector/rector-prefixed/bin/rector:39
Stack trace:
#0 {main}
  thrown in /Users/[...]/vendor/rector/rector-prefixed/bin/rector on line 39
Fatal error: Uncaught Error: Class 'Rector\Core\Console\Style\SymfonyStyleFactory' not found in /Users/[...]/vendor/rector/rector-prefixed/bin/rector:39
Stack trace:
#0 {main}
  thrown in /Users/[...]vendor/rector/rector-prefixed/bin/rector on line 39

Minimal PHP Code Causing Issue

Expected Behaviour

Rector running properly.

bug prefixed

Most helpful comment

Hello,

Did there is any workaround to use rector to upgrade a symfony 2.8 project ?

A suggested workaround : use the previous version 0.8.52 wich is based on a phar.

If you current environment contains version 0.8.56, first of all remove it :
_composer remove rector/rector-prefixed._

Then install the previous version :
_composer require rector/rector-prefixed 0.8.52_

_Note : the command init does not work in this version. You will have to copy the rector.php.dist by hand in your main directory._

All 10 comments

I've seen @michaljusiega comment in #4606 but I feel like this is a separate issue not related to PHPStan. I came across that comment by luck and feel that a separate ticket will be easier to find and track for others so they know when it's fixed.

No, is not related to PHPStan issue.

It doesn't duplicates #4725 as I have it installed as a normal Composer dependency, not a global one.

Sorry „duplicates“ was the wrong wording. It seems to be the same error though :)

Hello,

Did there is any workaround to use rector to upgrade a symfony 2.8 project ?

@TomasVotruba could you help us with this issue?

@simivar Basically, this PR needs to be finished: https://github.com/rectorphp/rector/pull/4559
The fix is included there. I'm busy with other work, so no ETA on it. Any help is welcomed there.

Hello,

Did there is any workaround to use rector to upgrade a symfony 2.8 project ?

A suggested workaround : use the previous version 0.8.52 wich is based on a phar.

If you current environment contains version 0.8.56, first of all remove it :
_composer remove rector/rector-prefixed._

Then install the previous version :
_composer require rector/rector-prefixed 0.8.52_

_Note : the command init does not work in this version. You will have to copy the rector.php.dist by hand in your main directory._

Was this page helpful?
0 / 5 - 0 ratings