PhpStorm 2019.3 Help

Configuring Joomla! Support

PhpStorm 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 PhpStorm 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 PhpStorm 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 PhpStorm, 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 Installing and configuring PHP_CodeSniffer. Probably the easiest way is to install it with Composer.

Install PHP_CodeSniffer

  1. From the composer.json context menu, 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_CodeSniffer.

Install Joomla Coding Standards

  1. From the composer.json context menu, 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_CodeSniffer 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_CodeSniffer as a PhpStorm inspection for details.

Last modified: 6 April 2020