PHPStorm and TYPO3 code formatting

By | 20/09/2011

I was searching for the import function almost forever until I figured out how to use the TYPO3 code formatting xml file provided in the TYPO3 wiki.

So here is a short article how to import the file and where to find it.

  1. Download the xml file from: http://wiki.typo3.org/File:Standard.xml
  2. [optional] Open the xml file in the editor of your choice and change the schema name at the top of the file from Standard to something that is later more easy to identify in your IDE.
  3. Copy the file to your user-files for PHPStorm, depending on your system. In Windows7 it is in C:\\Users\\<username>\\.WebIde10\\config\\codestyles
  4. Restart your IDE if it is running, otherwise just start it.
  5. Go to: Settings -> Code Style
  6. If you copied the file to the correct place it should show up in the select box. If you choose the option at point 2 and renamed the schema, you will find it under the new name, otherwise it will be “Standard”
  7. Select it, press apply, enjoy clean code.

But remember, good code formatting alone does not make good code ๐Ÿ˜‰

Hope I could help someone.

Update (thx @tolleiv):

For the Max OSX users โ€“ /Users//Library/Preferences/WebIDE10/codestyles