The rule php:S1451 “Track lack of copyright and license headers” cannot be used in PhpStorm
SonarLint 220.127.116.1142 in PhpStorm 2019.3.1
Steps to activate:
- Start PhpStorm with any PHP project
- Navigate to Settings => Other Settings => SonarLint General Settings => Rules => PHP
- Activate rule “Track lack of copyright and license headers”
- Save the settings
- Navigat to any PHP file disregarding its content
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.