Skip to content

Commit c22fd18

Browse files
committed
AC-672: Create phpcs static check for LicenseTest
1 parent e3cdba0 commit c22fd18

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

Magento2/Sniffs/Legacy/LicenseSniff.php

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,14 @@
1313

1414
class LicenseSniff implements Sniff
1515
{
16-
private const WARNING_CODE = 'FoundLegacyTextInCopyright';
17-
16+
/**
17+
* A list of tokenizers this sniff supports.
18+
*
19+
* @var array
20+
*/
1821
public $supportedTokenizers = [TokenizerSymbolsInterface::TOKENIZER_CSS, 'PHP'];
22+
23+
private const WARNING_CODE = 'FoundLegacyTextInCopyright';
1924

2025
/**
2126
* @inheritdoc
@@ -42,12 +47,14 @@ public function process(File $phpcsFile, $stackPtr)
4247
if ($tokens[$stackPtr]['code'] === T_INLINE_HTML) {
4348
$content = $phpcsFile->getTokensAsString($stackPtr, 1);
4449
}
45-
if ($content != null){
46-
$this->checkLicense($content, $stackPtr, $phpcsFile);
50+
if ($content != null) {
51+
$this->checkLicense($content, $stackPtr, $phpcsFile);
4752
}
4853
}
4954

5055
/**
56+
* Check that the copyright license does not contain legacy text
57+
*
5158
* @param string $content
5259
* @param int $stackPtr
5360
* @param File $phpcsFile

0 commit comments

Comments
 (0)