IntelliJ IDEA 2018.3 Help

Quality Tools

File | Settings | Languages and Frameworks | PHP | Quality Tools for Windows and Linux
IntelliJ IDEA | Preferences | Languages and Frameworks | PHP | Quality Tools for macOS
Ctrl+Alt+S icons general settings svg


The page is available only when the PHP plugin is enabled. The plugin is not bundled with IntelliJ IDEA, but it can be installed from the JetBrains plugin repository as described in Managing Plugins.

Code Sniffer

In this section, choose the Code Sniffer script to use.

Item

Description

Configuration

Choose the Code Sniffer script:
  • To use the script associated with a specific remote PHP interpreter, choose the name of this interpreter.

  • To use a local script, choose Local. In this case the local Code Sniffer will be executed no matter which PHP interpreter - local or remote - is used in the project. Note that there can be only one Local configuration for Code Sniffer because IntelliJ IDEA runs a script (phpcs.bat for Windows or phpcs for Linux and macOS) that contains a path to a PHP engine.

  • To use the script associated with the default project interpreter, that is, the one chosen on the PHP page of the Settings dialog, choose By default project interpreter.

Ignored files

Click to open the Code Sniffer ignored files dialog, which lists the files that Code Sniffer skips. IntelliJ IDEA suggests adding a new file to the list during inspection when waiting for response from the Code Sniffer exceeds the limit specified in the Tool process timeout field. This is done to prevent slowing down processing. For each file, IntelliJ IDEA displays its name and location.

  • To add a file, click icons general add svg and locate the desired file in the dialog that opens.

  • To delete a file from the list and have Code Sniffer process it again, select the file and click the Remove file button icons general remove svg.

  • To remove all the files from the list, click icons actions close svg.

Code Sniffer Dialog

The dialog opens when you click browseButton next to the Configuration list on the Code Sniffer page.

Use this dialog to configure local Code Sniffer scripts or scripts associated with remote PHP interpreters as well as configure Code Sniffer's behaviour. See PHP Code Sniffer for details.

Item

Description

PHP Code Sniffer (phpcs) Path

In this text box, specify the location of the Code Sniffer utility phpcs or phpcs.bat.

If the script is associated with a PHP interpreter, IntelliJ IDEA detects the path to it and fills in the field automatically but you can edit it if necessary. Type the path manually or click Browse browseButton and select the path in the dialog that opens.

To check that the specified path to phpcs.bat or phpcs ensures interaction between IntelliJ IDEA and Code Sniffer, that is, the tool can be launched from IntelliJ IDEA and IntelliJ IDEA will receive problem reports from it, click the Validate button. This validation is equal to running the phpcs --version command. If validation passes successfully, IntelliJ IDEA displays the information on the detected Code Sniffer version.

Interpreter

The field shows the chosen PHP interpreter to use the Code Sniffer from.

Maximum number of messages per file

In this text box, set the upper limit for the total number of messages to be reported for a file. All the messages above this limit will be rejected. IntelliJ IDEA will display the following warning right in the code: Too many PHP Code Sniffer messages and suggest adding the file to the Ignored files list.

Tool process timeout

In this text box, specify how long you want IntelliJ IDEA to wait for a result from PHP Code Sniffer, whereupon the process is killed to prevent excessive CPU and memory usage. This gives you the capability to fine tune the PHP Code Sniffer process behavior depending on the configuration of your computer and the rule sets used.

Mess Detector

In this section, choose the Mess Detector script to use.

Item

Description

Configuration

Choose the Mess Detector script:
  • To use the script associated with a specific remote PHP interpreter, choose the name of this interpreter.

  • To use a local script, choose Local. In this case the local Mess Detector will be executed no matter which PHP interpreter - local or remote - is used in the project. Note that there can be only one Local configuration for Mess Detector because IntelliJ IDEA runs a script (phpmd.bat for Windows or phpmd for Linux and macOS) that contains a path to a PHP engine.

  • To use the script associated with the default project interpreter, that is, the one chosen on the PHP page of the Settings dialog, choose By default project interpreter.

Ignored files

Click to open the Mess Detector ignored files dialog, which lists the files that Mess Detector skips. IntelliJ IDEA suggests adding a new file to the list during inspection when waiting for response from the Mess Detector exceeds the limit specified in the Tool process timeout field. This is done to prevent slowing down processing. For each file, IntelliJ IDEA displays its name and location.

  • To add a file, click icons general add svg and locate the desired file in the dialog that opens.

  • To delete a file from the list and have Mess Detector process it again, select the file and click the Remove file button icons general remove svg.

  • To remove all the files from the list, click icons actions close svg.

Mess Detector Dialog

The dialog opens when you click browseButton next to the Configuration list on the Mess Detector page.

Use this dialog to configure local Mess Detector scripts or scripts associated with remote PHP interpreters as well as configure Mess Detector's behaviour. See PHP Mess Detector for details.

Item

Description

PHP Mess Detector (phpmd) Path

In this text box, specify the location of the Mess Detector utility phpmd or phpmd.bat.

If the script is associated with a PHP interpreter, IntelliJ IDEA detects the path to it and fills in the field automatically but you can edit it if necessary. Type the path manually or click Browse browseButton and select the path in the dialog that opens.

To check that the specified path to phpmd.bat or phpmd ensures interaction between IntelliJ IDEA and Mess Detector, that is, the tool can be launched from IntelliJ IDEA and IntelliJ IDEA will receive problem reports from it, click the Validate button. This validation is equal to running the phpmd --version command. If validation passes successfully, IntelliJ IDEA displays the information on the detected Mess Detector version.

Interpreter

The field shows the chosen PHP interpreter to use the Mess Detector from.

Maximum number of messages per file

In this text box, set the upper limit for the total number of messages to be reported for a file. All the messages above this limit will be rejected. IntelliJ IDEA will display the following warning right in the code: Too many PHP Mess Detector messages and suggest adding the file to the Ignored files list.

Tool process timeout

In this text box, specify how long you want IntelliJ IDEA to wait for a result from PHP Mess Detector, whereupon the process is killed to prevent excessive CPU and memory usage. This gives you the capability to fine tune the PHP Mess Detector process behavior depending on the configuration of your computer and the rule sets used.

PHP CS Fixer

In this section, choose the PHP CS Fixer script to use.

Item

Description

Configuration

Choose the PHP CS Fixer script:
  • To use the script associated with a specific remote PHP interpreter, choose the name of this interpreter.

  • To use a local script, choose Local. In this case the local PHP CS Fixer will be executed no matter which PHP interpreter - local or remote - is used in the project. Note that there can be only one Local configuration for PHP CS Fixer because IntelliJ IDEA runs a script (php-cs-fixer.bat for Windows or php-cs-fixer for Linux and macOS) that contains a path to a PHP engine.

  • To use the script associated with the default project interpreter, that is, the one chosen on the PHP page of the Settings dialog, choose By default project interpreter.

Ignored files

Click to open the PHP CS Fixer ignored files dialog, which lists the files that PHP CS Fixer skips. IntelliJ IDEA suggests adding a new file to the list during inspection when waiting for response from the PHP CS Fixer exceeds the limit specified in the Tool process timeout field. This is done to prevent slowing down processing. For each file, IntelliJ IDEA displays its name and location.

  • To add a file, click icons general add svg and locate the desired file in the dialog that opens.

  • To delete a file from the list and have PHP CS Fixer process it again, select the file and click the Remove file button icons general remove svg.

  • To remove all the files from the list, click icons actions close svg.

PHP CS Fixer Dialog

The dialog opens when you click browseButton next to the Configuration list on the PHP CS Fixer page.

Use this dialog to configure local PHP CS Fixer scripts or scripts associated with remote PHP interpreters as well as configure PHP CS Fixer's behaviour. See PHP CS Fixer for details.

Item

Description

PHP PHP CS Fixer (php-cs-fixer) Path

In this text box, specify the location of the PHP CS Fixer utility php-cs-fixer or php-cs-fixer.bat.

If the script is associated with a PHP interpreter, IntelliJ IDEA detects the path to it and fills in the field automatically but you can edit it if necessary. Type the path manually or click Browse browseButton and select the path in the dialog that opens.

To check that the specified path to php-cs-fixer.bat or php-cs-fixer ensures interaction between IntelliJ IDEA and PHP CS Fixer, that is, the tool can be launched from IntelliJ IDEA and IntelliJ IDEA will receive problem reports from it, click the Validate button. This validation is equal to running the php-cs-fixer --version command. If validation passes successfully, IntelliJ IDEA displays the information on the detected PHP CS Fixer version.

Interpreter

The field shows the chosen PHP interpreter to use the PHP CS Fixer from.

Maximum number of messages per file

In this text box, set the upper limit for the total number of messages to be reported for a file. All the messages above this limit will be rejected. IntelliJ IDEA will display the following warning right in the code: Too many PHP PHP CS Fixer messages and suggest adding the file to the Ignored files list.

Tool process timeout

In this text box, specify how long you want IntelliJ IDEA to wait for a result from PHP PHP CS Fixer, whereupon the process is killed to prevent excessive CPU and memory usage. This gives you the capability to fine tune the PHP PHP CS Fixer process behavior depending on the configuration of your computer and the rule sets used.

Last modified: 7 December 2018

See Also