IntelliJ IDEA 2019.2 Help

Configuring 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.

Joomla Event Log

Changing the Joomla! settings

Enable or disable Joomla! integration

  • In the Settings/Preferences dialog (Ctrl+Alt+S), navigate to Languages and Frameworks | PHP | Frameworks. 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/Preferences dialog (Ctrl+Alt+S), navigate to the Editor | Code Style | PHP page and update the settings as necessary.

Checking code against the Joomla coding standards

With IntelliJ IDEA, you can use the PHP Code Sniffer tool, which detects coding standard issues, in combination with Joomla Coding Standards, which provides a set of Joomla-specific standards to PHP Code Sniffer. This will ensure that your code is clean, consistent, and free of some common errors.

To get started, install PHP Code Sniffer using any technique described in Installing and configuring PHP Code Sniffer. Probably the easiest way is to install it with Composer.

Install PHP Code Sniffer

  1. From the context menu of composer.json, choose Composer | Manage Dependencies. Alternatively choose Tools | Composer | Manage Dependencies from the main menu.

  2. In the Manage Composer Dependencies Dialog that opens, select the squizlabs/php_codesniffer package from the Available Packages list, possibly using the search field.

    Choose the relevant version from the Version to install list.

  3. If necessary, expand the Settings hidden area and specify the advanced installation options. In the Command line parameters field, type the additional command line parameters.

  4. Click Install.

Next, install Joomla Coding Standards, which will provide Joomla-specific standards to PHP Code Sniffer.

Install Joomla Coding Standards

  1. From the context menu of composer.json, choose Composer | Manage Dependencies. Alternatively choose Tools | Composer | Manage Dependencies from the main menu.

  2. In the Manage Composer Dependencies Dialog that opens, select the joomla/coding-standards package from the Available Packages list, possibly using the search field.

    Choose the relevant version from the Version to install list.

  3. If necessary, expand the Settings hidden area and specify the advanced installation options. In the Command line parameters field, type the additional command line parameters.

  4. Click Install.

The Joomla Coding Standards package will be installed, and the corresponding Joomla standard will be selected for the PHP Code Sniffer validation inspection automatically. If necessary, you can further customize the inspection on the Editor | Inspections page of the Settings/Preferences dialog (Ctrl+Alt+S). See Configuring PHP Code Sniffer as a IntelliJ IDEA inspection for details.

Last modified: 17 October 2019