SonarCloud | Advanced setup | Languages | PHP

Was this page helpful?

On this page

Start FreeLog in

PHP

Supported versions

VersionStatus
5.xFully Supported
7.xFully Supported
8.xFully Supported

Language-specific properties

Discover and update the PHP-specific properties in the project Administration > General Settings > Languages > PHP

Turning issues off

The best way to deactivate an individual issue you don't intend to fix is to mark it as accepted or false positive through the Sonar UI.

If you need to deactivate a rule (or all rules) for an entire file, then issue exclusions are the way to go. But if you only want to deactivate a rule across a subset of a file - all the lines of a method or a class - you can use a PHPDoc comment /* @SuppressWarnings("php:S2077") */ or an attribute #[SuppressWarnings("php:S2077")].

Analyze php.ini files

The PHP analyzer can analyze php.ini files with some specific rules (if these rules are activated in your quality profile). php.ini files must be part of the project you are analyzing, meaning the php.ini files have to be inside the directories listed in sonar.sources. Rules targeting php.ini files can be quickly identified through the "php-ini" tag set on them.

© 2008-2024 SonarSource SA. All rights reserved. SONAR, SONARSOURCE, SONARLINT, SONARQUBE, SONARCLOUD, and CLEAN AS YOU CODE are trademarks of SonarSource SA.

Creative Commons License