Configuration
Download the Joomla PhpStorm codestyle configuration (from the Coding Standards github repository). And copy it to your PhpStorm config directory:
When you installed wget with brew (you can also use curl) you can do this with:
cd ~/Library/Preferences/PhpStorm2016.1/codestyles && \
wget -O joomla.xml https://raw.githubusercontent.com/joomla/coding-standards/master/IDE/joomla_phpstorm.xml
Now open the Preferences (PhpStorm -> Preferences) and select Editor -> Code Style.
Choose "Joomla" in the Scheme select and apply the changes.
Useful other settings
When you open a project you should always add a clean Joomla project as External Library. Also set PHP version to 5.3.10 (when you want to work on core).
At Editor -> General -> Appearance you should enable the following settings:
- Show line numbers
- Show whitespaces
This makes formatting your code far easier!
Joomla support
With the the newest (EAP) 2016.1.1 Build #PS-145.969 version PhpStorm now also supports Joomla! Just install the plugin from the repository.
Code Sniffer
In the Preferences navigate to Languages & Frameworks -> PHP -> Code Sniffer and click on ... next to the select.
In it set the phpcs path to /usr/bin/phpcs
and click on validate.
Set the maximimum number of messages to 100 and the total process time to 30.