Skip to content

Commit f4b0117

Browse files
committed
AC-666: Create phpcs static check for CopyrightTest
1 parent e2c2d07 commit f4b0117

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

Magento2/Sniffs/Legacy/CopyrightSniff.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public function process(File $phpcsFile, $stackPtr)
4040
if (strpos($contentFile, self::COPYRIGHT_MAGENTO_TEXT) === false || $adobeCopyrightFound === false) {
4141
$phpcsFile->addWarningOnLine(
4242
'Copyright is missing or has wrong format',
43-
null,
43+
$phpcsFile->getTokens()[$positionComment]['line'],
4444
self::WARNING_CODE
4545
);
4646
}

Magento2/Tests/Legacy/CopyrightUnitTest.php

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,17 @@ public function getWarningList($testFile = ''): array
2626
return [];
2727
}
2828

29-
return [
30-
null => 1,
31-
];
29+
if ($testFile === 'CopyrightUnitTest.1.inc') {
30+
return [
31+
1 => 1,
32+
];
33+
}
34+
if ($testFile === 'CopyrightUnitTest.2.inc' || 'CopyrightUnitTest.3.inc') {
35+
return [
36+
3 => 1,
37+
];
38+
}
39+
40+
return [];
3241
}
3342
}

0 commit comments

Comments
 (0)