phpinsights
phpinsights copied to clipboard
[Feature] Rector Wrapper
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.
@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
@Jibbarth Thanks a lot :heart: Yes you should test it out. At this point I really need to make sure it is fully functional.
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 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 are you planning to use the latest Rector version (0.11 at the moment)?
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.
@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.
Closing as a stale PR