2019 Update
It seems this question is still active in 2019. Nowadays there are new technologies, that can automate all PHP-related work.
Thanks to tools like:
- php-parser
- Rector - a tool I wrote to automate PHP migrations and refactorings
you can:
- prepare rules to A → B migration
- then run it on your code base
- it will change all the patterns there, no matter if 10 k lines of 1 000 k lines
See a more detailed answer.
Let me know if you need more specific answer tailored to your project.