Magento 2 – Code Formatting Settings for PHPStorm

magento2phpstorm

When editing Magento2 .phtml files, it would be nice to use the code formating function of PhpStorm, but without changing the original layout (just format added stuff).

So did anybody already set up PHPStorm's format settings for Magento2 and would like to share them?

Best Answer

Magento 2 team use PSR1/PSR2 code styles (in PHPStorm: preferences > Code Style > PHP > set from > PSR1/PSR2) and verify it with static test Magento\Test\Php\LiveCodeTest::testCodeStylePsr2