Rector: Rector Integration

Created on 6 Apr 2020  路  7Comments  路  Source: rectorphp/rector

Question

Hi,

Congrats for your amazing project. I really enjoy your work.

I have a question and I can use your help. Is there any easy and efficient way for Rector integration with other OSS? Because we want to integrate Rector and it can really help to getting ideas and saving time.

Thanks.

Most helpful comment

It will be very limited and require bit learning from you side, but you can use ContainerFactory, create container, then get RectorApplication and use it.

See bin/rector to see more

All 7 comments

Hi, what exactly do you mean? Example of your goal would help

@TomasVotruba So, I contribute in PhpInsights. So, for v2.0 we want to add Rector to it and I want to know is there any proper way to do that? Do you have any external API's to make this work or anything else?

I see.

When you run Rector, you can use 3 different output formatters, e.g.

vendor/bin/rector process src --dry-run --output-format json

The output formatters are located here:
https://github.com/rectorphp/rector/tree/master/packages/changes-reporting/src/Output

Thanks a lot! I will close this issue then. If anything comes up, I will use your help again :sweat_smile:

@TomasVotruba So, I digging more a little bit in Rector. Now I want to know how can we run rector without using CLI tool? I want to trigger it from our code so we'll be able to control the flow.

BTW, thanks for your email.

It will be very limited and require bit learning from you side, but you can use ContainerFactory, create container, then get RectorApplication and use it.

See bin/rector to see more

@TomasVotruba It's awesome! Actually yesterday I did use it but didn't know it's the best approach. Thanks again :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

carusogabriel picture carusogabriel  路  5Comments

donbrico picture donbrico  路  4Comments

benr77 picture benr77  路  4Comments

jakzal picture jakzal  路  4Comments

DaveLiddament picture DaveLiddament  路  5Comments