Configure Joomla! support
IntelliJ IDEA checks if the development environment is configured properly for Joomla! development.
Any detected inconsistency is reported in the Event Log tool window and as a popup. For each discrepancy IntelliJ IDEA suggests a fix. To apply a suggestion, click the link next to the reported event.
Changing the Joomla! settings
Install the PHP and Joomla! plugins
This functionality relies on the PHP and Joomla! plugins that should be installed and enabled in your IDE.
The plugins are available only in IntelliJ IDEA Ultimate.
Press Control+Alt+S to open the IDE settings and select
.Switch to the Marketplace tab and use the search field to find the PHP and Joomla! plugins.
Click Install and restart the IDE if prompted.
Enable or disable Joomla! integration
In the Settings dialog (Control+Alt+S), navigate to . On the Frameworks page that opens, toggle the Enable Joomla! integration checkbox to activate or deactivate Joomla! in the current IntelliJ IDEA project.
To use another Joomla! installation, type the path to the relevant installation folder.
Set the code style
In the Settings dialog (Control+Alt+S), navigate to the page and update the settings as necessary.
Checking code against the Joomla coding standards
With IntelliJ IDEA, you can use the PHP_CodeSniffer tool, which detects coding standard issues, in combination with Joomla Coding Standards, which provides a set of Joomla-specific standards to PHP_CodeSniffer. This will ensure that your code is clean, consistent, and free of some common errors.
To get started, install PHP_CodeSniffer using any technique described in Install and configure PHP_CodeSniffer. Probably the easiest way is to install it with Composer.
Install PHP_CodeSniffer
Inside composer.json, add the
squizlabs/php_codesniffer
dependency record to therequire
orrequire-dev
section. Press Control+Space to get code completion for the package name and version.Do one of the following:
Click the Install shortcut link on top of the editor panel.
If the Non-installed Composer packages inspection is enabled, IntelliJ IDEA will highlight the declared dependencies that are not currently installed. Press Alt+Enter and select whether you want to install a specific dependency or all dependencies at once.
Next, install Joomla Coding Standards, which will provide Joomla-specific standards to PHP_CodeSniffer.
Install Joomla Coding Standards
Inside composer.json, add the
joomla/coding-standards
dependency record to therequire
orrequire-dev
section. Press Control+Space to get code completion for the package name and version.Do one of the following:
Click the Install shortcut link on top of the editor panel.
If the Non-installed Composer packages inspection is enabled, IntelliJ IDEA will highlight the declared dependencies that are not currently installed. Press Alt+Enter and select whether you want to install a specific dependency or all dependencies at once.
The Joomla Coding Standards package will be installed, and the corresponding Joomla standard will be selected for the PHP_CodeSniffer validation inspection automatically. If necessary, you can further customize the inspection on the page of the Settings dialog (Control+Alt+S). See Enable PHP_CodeSniffer as an IntelliJ IDEA inspection for details.