MediaWiki-CodeSniffer
MediaWiki CodeSniffer Standards
Loading...
Searching...
No Matches
MediaWiki\Sniffs\Commenting\ClassLevelLicenseSniff Class Reference

Custom sniff that requires all classes, interfaces, traits, and enums in a codebase to have the same license doc tag. More...

+ Inheritance diagram for MediaWiki\Sniffs\Commenting\ClassLevelLicenseSniff:

Public Member Functions

 register ()
 @inheritDoc
 
 process (File $phpcsFile, $stackPtr)
 @inheritDoc
 

Public Attributes

string $license = ''
 

Detailed Description

Custom sniff that requires all classes, interfaces, traits, and enums in a codebase to have the same license doc tag.

Note this sniff doesn't do anything by default. You need to enable it in your .phpcs.xml if you want to use it: <rule ref="MediaWiki.Commenting.ClassLevelLicense"> <properties> <property name="license" value="GPL-2.0-or-later" > </properties> </rule>

Doing so makes the LicenseComment sniff obsolete. You might want to disable it: <exclude name="MediaWiki.Commenting.LicenseComment" >

@license GPL-2.0-or-later

Author
Thiemo Kreuz

The documentation for this class was generated from the following file: