rector icon indicating copy to clipboard operation
rector copied to clipboard

Rector is breaking symfony service definitions that use `factory()`

Open nesl247 opened this issue 1 year ago • 1 comments

Bug Report

Subject Details
Rector version 1.2.10

Rector is changing symfony service factory calls and breaking them.

Uncaught Error: Symfony\Component\DependencyInjection\Loader\Configurator\ServiceConfigurator::factory(): Argument #1 ($factory) must be of type Symfony\Component\DependencyInjection\Loader\Configurator\ReferenceConfigurator|Symfony\Component\ExpressionLanguage\Expression|array|string, Closure give

Minimal PHP Code Causing Issue

        ->set(EventPublisher::class, GuzzleEventPublisher::class)
        ->factory([
            Guzzle::class,
            'eventPublisher',
        ]);

I didn't post a link to the demo because this requires Symfony. It's also straight forward enough that I'm assuming a reproducer isn't needed.

Expected Behaviour

Skip it

nesl247 avatar Dec 12 '24 21:12 nesl247

Thank you for your report!

We'll need an isolated failing demo link from: http://getrector.com/demo, that way we can reproduce the bug.

TomasVotruba avatar Dec 12 '24 23:12 TomasVotruba

I am closing it as lack of feedback and don't have simple repository to reproduce, feel free to re-open the issue with provide simple reproducible repo so we can check if the issue persist. Thank you.

samsonasik avatar Jan 08 '25 03:01 samsonasik