In any of our new projects, modules and extensions we follow the PSR-1 Basic Coding Standard and PSR-2 Coding Style Guide. However, not all projects we are working on are started from scratch. In general we try to stick to the coding style used around us. Consistency is most important.

PHPStorm Integration

Most of our developers use PHPStorm as their IDE, so we have created the Meanbee.xml code style scheme to keep our IDE settings consistent. To use it, place the xml file inside the config/codestyles directory under the PHPStorm home directory and enable it in Preferences > Editor > Code Style.

We also have our PHPStorm configured to run PHP_CodeSniffer to highlight any coding style issues. To set it up, you can follow this tutorial, which also provides Code Sniffer standards for Magento 1.