php-coding-standards
php-coding-standards copied to clipboard
[Feature Request]: License file header sniff
Is your feature request related to a problem?
A lot of (legacy) code contains license information in the file header. Recently, it was decided to no longer include any license information in file headers, and instead only supply a dedicated LICENSE file and explicitly link to it from the README.md file.
The license information can vary, but most packages that were created via copy/paste or with our generator will have one of the following headers or snippets:
/**
*
* (c) Inpsyde GmbH
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* @author AuthorName <[email protected]>
* @license GPLv2+
* @link https://www.inpsyde.com
*/
—OR—
/**
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
*/
We want people to know about these obsolete license file headers, so they can remove them. Ideally, removal could happen automatically, which has yet to be explored.
Describe the desired solution
Report on PHP file headers that contain license information only. Trigger a warning, and maybe even allow for automatically fixing/removing (parts of) the file header.
Describe the alternatives that you have considered
Alternatives are to trigger an error instead of a warning, which was decided against (for the Inpsyde PHP Coding Standards), or to not report on these file headers.
Additional context
No response
Code of Conduct
- [X] I agree to follow this project's Code of Conduct