phpinsights icon indicating copy to clipboard operation
phpinsights copied to clipboard

[Feature] Rector Wrapper

Open 50bhan opened this issue 4 years ago • 7 comments

Q A
Bug fix? no
New feature? yes
Fixed tickets #200

Following V2 road map, this PR will add Rector (https://github.com/rectorphp/rector) wrapper to the project. There are couple of tasks which need to be done to complete this feature:

  • [x] Add wrapper
  • [x] Increase stability
  • [x] Add some default Rectors
  • [ ] Add refactor command
  • [ ] Add more tests
  • [ ] Update doc

P.S: The PR is functional (especially with added Rector and its type), but there are some problem with some rectors at this moment. So I should fix them.

50bhan avatar May 13 '20 14:05 50bhan

@olivernybroe @Jibbarth I tested out the code with all Rectors (literally all 477 of them :smile:) and it seems more stable now. So, I would appreciate if you guys also check it out.

P.S. I made a gist with all Rectors in functions.php metric file for testing purposes which you can use: https://gist.github.com/50bhan/86201591fc7a25697c1715473fb0373a

50bhan avatar May 15 '20 11:05 50bhan

@Jibbarth Thanks a lot :heart: Yes you should test it out. At this point I really need to make sure it is fully functional.

50bhan avatar May 18 '20 05:05 50bhan

Awesome work!

Hmm, would it make sense to have like a test that actually tests if it is able to run with all of the rectors?

olivernybroe avatar May 18 '20 06:05 olivernybroe

@olivernybroe Thank you :slightly_smiling_face: Yes we can do that. But I wanted to make sure that the code is functional in real use, so I tested it manually and prepare a gist of all Rectors for testing. If you feel it is necessary, I will add a test with this criteria.

50bhan avatar May 18 '20 06:05 50bhan

@50bhan are you planning to use the latest Rector version (0.11 at the moment)?

roman-eonx avatar Jul 12 '21 09:07 roman-eonx

Allow me to say, that I don't think is a good idea to have this feature at this time.

I think we should focus the time of the maintainers, on improving the existing "features", making Laravel rules more idiomatic for Laravel users, re-working the documentation, etc.

nunomaduro avatar Jul 12 '21 10:07 nunomaduro

@roman-eonx As @nunomaduro said, we're not gonna add this feature at the moment 🙂 But if we plan to do this, we'll use the latest version of rector and this PR will be updated based on it.

50bhan avatar Jul 12 '21 10:07 50bhan

Closing as a stale PR

JustSteveKing avatar Sep 07 '22 08:09 JustSteveKing