Rector is a CLI tool written in PHP. It can instantly upgrade old PHP code and handle automated refactorings.