Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/develop' into simplify-install…
Browse files Browse the repository at this point in the history
…-instructions
  • Loading branch information
fredden committed Sep 7, 2023
2 parents 55c28a9 + db2e2e7 commit 65a4b0c
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ class CopyrightAnotherExtensionsFilesSniff implements Sniff

private const COPYRIGHT_MAGENTO_TEXT = 'Copyright © Magento, Inc. All rights reserved.';
private const COPYRIGHT_ADOBE = '/Copyright \d+ Adobe/';
private const COPYRIGHT_ADOBE_TEXT = 'ADOBE CONFIDENTIAL';

/**
* Defines the tokenizers that this sniff is using.
Expand Down Expand Up @@ -48,6 +49,7 @@ public function process(File $phpcsFile, $stackPtr)

if (strpos($fileText, self::COPYRIGHT_MAGENTO_TEXT) !== false
|| preg_match(self::COPYRIGHT_ADOBE, $fileText)
|| strpos($fileText, self::COPYRIGHT_ADOBE_TEXT) !== false
) {
return;
}
Expand Down
5 changes: 4 additions & 1 deletion Magento2Framework/Sniffs/Header/CopyrightGraphQLSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ class CopyrightGraphQLSniff implements Sniff

private const COPYRIGHT_MAGENTO_TEXT = 'Copyright © Magento, Inc. All rights reserved.';
private const COPYRIGHT_ADOBE = '/Copyright \d+ Adobe/';
private const COPYRIGHT_ADOBE_TEXT = 'ADOBE CONFIDENTIAL';

private const FILE_EXTENSION = 'graphqls';

Expand Down Expand Up @@ -44,7 +45,9 @@ public function process(File $phpcsFile, $stackPtr)
// @phpcs:ignore Magento2.Functions.DiscouragedFunction.Discouraged
$content = file_get_contents($phpcsFile->getFilename());

if (strpos($content, self::COPYRIGHT_MAGENTO_TEXT) !== false || preg_match(self::COPYRIGHT_ADOBE, $content)) {
if (strpos($content, self::COPYRIGHT_MAGENTO_TEXT) !== false
|| preg_match(self::COPYRIGHT_ADOBE, $content)
|| strpos($content, self::COPYRIGHT_ADOBE_TEXT) !== false) {
return;
}

Expand Down
5 changes: 4 additions & 1 deletion Magento2Framework/Sniffs/Header/CopyrightSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ class CopyrightSniff implements Sniff

private const COPYRIGHT_MAGENTO_TEXT = 'Copyright © Magento, Inc. All rights reserved.';
private const COPYRIGHT_ADOBE = '/Copyright \d+ Adobe/';
private const COPYRIGHT_ADOBE_TEXT = 'ADOBE CONFIDENTIAL';

/**
* @inheritdoc
Expand Down Expand Up @@ -48,7 +49,9 @@ public function process(File $phpcsFile, $stackPtr)
$content = $phpcsFile->getTokens()[$positionComment]['content'];
$adobeCopyrightFound = preg_match(self::COPYRIGHT_ADOBE, $content);

if (strpos($content, self::COPYRIGHT_MAGENTO_TEXT) !== false || $adobeCopyrightFound) {
if (strpos($content, self::COPYRIGHT_MAGENTO_TEXT) !== false ||
$adobeCopyrightFound ||
strpos($content, self::COPYRIGHT_ADOBE_TEXT) !== false) {
return;
}

Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"AFL-3.0"
],
"type": "phpcodesniffer-standard",
"version": "31",
"version": "32",
"require": {
"php": "~8.1.0 || ~8.2.0",
"dealerdirect/phpcodesniffer-composer-installer": "^0.7.2 || ^1.0",
Expand All @@ -15,7 +15,7 @@
"ext-dom": "*",
"phpcompatibility/php-compatibility": "^9.3",
"squizlabs/php_codesniffer": "^3.6.1",
"rector/rector": "^0.15.10",
"rector/rector": "0.17.12",
"symfony/polyfill": "^1.16",
"phpcsstandards/phpcsutils": "^1.0.5"
},
Expand Down
45 changes: 24 additions & 21 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 65a4b0c

Please sign in to comment.