Rule php:S1451 "Track lack of copyright and license headers" cannot be used in PhpStorm


The rule php:S1451 “Track lack of copyright and license headers” cannot be used in PhpStorm


SonarLint in PhpStorm 2019.3.1

Steps to activate:

  1. Start PhpStorm with any PHP project
  2. Navigate to Settings => Other Settings => SonarLint General Settings => Rules => PHP
  3. Activate rule “Track lack of copyright and license headers”
  4. Save the settings
  5. Navigat to any PHP file disregarding its content

Observed behavior:

SonarLint shows “Add or update the header of the file”

Violated rule detail:

Each source file should start with a header stating file ownership and the license which must be used to distribute the application.
This rule must be fed with the header text that is expected at the beginning of every file.


There is no way to “feed” this rule with a to be expected header text. At least not in PhpStorm or it is not obvious/documented well enough.

Hello, thank you for your feedback.

This is unfortunately not supported (yet) in the standalone experience, and indeed it would perfectly make sense for rules like php:S1451, which aren’t too useful without their parameter set.

Currently, the only way to provide parameters to rules that need them is by using SonarLint’s connected mode. This way, you can configure rules and their parameters in SonarQube or SonarCloud, and have all developers synchronize their rule sets and settings with the server.

Note that full offline configuration of rules has been already been suggested in this forum, feel free to vote for it to show your interest!