How to automatically convert "normal" conditions to yoda conditions

I am working on a large WordPress Plugin. It has already more than 10'000 lines of code (PHP + Javascript) and must be changed to yoda conditions, for matching the coding standards of WordPress.

Is there a program or an online tool that converts the code (Javascript + PHP) automatically to yoda conditions?

Topic coding-standards plugins Wordpress

Category Web


Yes, there is PHPCBF which can automatically fix some of them at least.

However, I'd suggest ignoring Yoda conditions. There is currently a proposal to drop yoda conditions from the coding standard in favour of stricter checks against assignments in control structures, while moving slowly has been well received.

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.