Skip to content

Commit 97dab81

Browse files
committedOct 19, 2021
Merge branch 'AC-1314' of github.com:eliseacornejo/magento-coding-standard into AC-1314
2 parents fd79554 + 9416fc8 commit 97dab81

4 files changed

+23
-1
lines changed
 

‎Magento2/Sniffs/Legacy/CopyrightAnotherExtensionsFilesSniff.php

+10-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
namespace Magento2\Sniffs\Legacy;
99

10+
use Magento2\Sniffs\Less\TokenizerSymbolsInterface;
1011
use PHP_CodeSniffer\Files\File;
1112
use PHP_CodeSniffer\Sniffs\Sniff;
1213

@@ -16,14 +17,22 @@ class CopyrightAnotherExtensionsFilesSniff implements Sniff
1617

1718
private const COPYRIGHT_MAGENTO_TEXT = 'Copyright © Magento, Inc. All rights reserved.';
1819
private const COPYRIGHT_ADOBE = '/Copyright \d+ Adobe/';
20+
21+
/**
22+
* Defines the tokenizers that this sniff is using.
23+
*
24+
* @var array
25+
*/
26+
public $supportedTokenizers = [TokenizerSymbolsInterface::TOKENIZER_CSS, 'PHP'];
1927

2028
/**
2129
* @inheritDoc
2230
*/
2331
public function register(): array
2432
{
2533
return [
26-
T_INLINE_HTML
34+
T_INLINE_HTML,
35+
T_OPEN_TAG
2736
];
2837
}
2938

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/**
2+
* Copyright © Magento, Inc.
3+
* See COPYING.txt for license details.
4+
*/
5+
6+
//@magento_import "magento_import.less";
7+
@import "dir/import.less";
8+

‎Magento2/Tests/Legacy/CopyrightAnotherExtensionsFilesUnitTest.php

+5
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@ public function getWarningList($testFile = '')
3636
if ($testFile === 'CopyrightAnotherExtensionsFilesUnitTest.4.js') {
3737
return [];
3838
}
39+
if ($testFile === 'CopyrightAnotherExtensionsFilesUnitTest.5.less') {
40+
return [
41+
null => 1,
42+
];
43+
}
3944
return [];
4045
}
4146
}

0 commit comments

Comments
 (0)
Please sign in to comment.