Skip to content

Commit 14992aa

Browse files
committed
Merge remote-tracking branch 'upstream/develop' into eslint
2 parents a1766bf + 243690c commit 14992aa

File tree

137 files changed

+1649
-1173
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

137 files changed

+1649
-1173
lines changed

.github/.metadata.json

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"templateVersion": "0.2",
3+
"product": {
4+
"name": "magento/magento-coding-standard",
5+
"description": "A set of Magento specific PHP CodeSniffer rules"
6+
},
7+
"contacts": {
8+
"team": {
9+
"name": "HAMMER",
10+
"DL": "Grp-RQ-HAMMER",
11+
"slackChannel": "gl-hammer-team"
12+
}
13+
},
14+
"ticketTracker": {
15+
"functionalJiraQueue": {
16+
"projectKey": "AC",
17+
"component": "Github"
18+
},
19+
"securityJiraQueue": {
20+
"projectKey": "MAGREQ",
21+
"component": "Commerce M2"
22+
}
23+
},
24+
"productionCodeBranches": ["develop"]
25+
}

.github/workflows/php.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@ jobs:
1313
fail-fast: false
1414
matrix:
1515
php-version:
16-
- "8.1"
1716
- "8.2"
17+
- "8.3"
18+
- "8.4"
1819
dependencies:
1920
- "lowest"
2021
- "highest"
@@ -24,7 +25,7 @@ jobs:
2425
- name: Setup node
2526
uses: actions/setup-node@v2
2627
with:
27-
node-version: '16'
28+
node-version: '21'
2829

2930
- uses: actions/checkout@v2
3031

@@ -64,7 +65,7 @@ jobs:
6465
- name: Setup node
6566
uses: actions/setup-node@v2
6667
with:
67-
node-version: '16'
68+
node-version: '21'
6869

6970
- uses: actions/checkout@v2
7071

@@ -81,12 +82,12 @@ jobs:
8182
- name: Setup node
8283
uses: actions/setup-node@v2
8384
with:
84-
node-version: '16'
85+
node-version: '21'
8586

8687
- uses: actions/checkout@v2
8788

8889
- name: Install dependencies
8990
run: composer install
9091

9192
- name: Run rector
92-
run: vendor/bin/rector process Magento2 Magento2Framework PHP_CodeSniffer --dry-run --autoload-file vendor/squizlabs/php_codesniffer/autoload.php --autoload-file vendor/phpcompatibility/php-compatibility/PHPCSAliases.php
93+
run: vendor/bin/rector process Magento2 Magento2Framework PHP_CodeSniffer --dry-run --autoload-file vendor/squizlabs/php_codesniffer/autoload.php --autoload-file vendor/magento/php-compatibility-fork/PHPCSAliases.php

Magento2/Helpers/Assert.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/**
3-
* Copyright © Magento, Inc. All rights reserved.
4-
* See COPYING.txt for license details.
3+
* Copyright 2023 Adobe
4+
* All Rights Reserved.
55
*/
66
declare(strict_types=1);
77

Magento2/Helpers/Commenting/PHPDocFormattingValidator.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?php
22

33
/**
4-
* Copyright © Magento, Inc. All rights reserved.
5-
* See COPYING.txt for license details.
4+
* Copyright 2019 Adobe
5+
* All Rights Reserved.
66
*/
77
namespace Magento2\Helpers\Commenting;
88

Magento2/Helpers/Tokenizer/AbstractTokenizer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/**
3-
* Copyright © Magento, Inc. All rights reserved.
4-
* See COPYING.txt for license details.
3+
* Copyright 2021 Adobe
4+
* All Rights Reserved.
55
*/
66
namespace Magento2\Helpers\Tokenizer;
77

Magento2/Helpers/Tokenizer/Parameter.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/**
3-
* Copyright © Magento, Inc. All rights reserved.
4-
* See COPYING.txt for license details.
3+
* Copyright 2021 Adobe
4+
* All Rights Reserved.
55
*/
66
namespace Magento2\Helpers\Tokenizer;
77

Magento2/Helpers/Tokenizer/Variable.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
<?php
22
/**
3-
* Copyright © Magento, Inc. All rights reserved.
4-
* See COPYING.txt for license details.
3+
* Copyright 2021 Adobe
4+
* All Rights Reserved.
55
*/
6-
76
namespace Magento2\Helpers\Tokenizer;
87

98
/**

Magento2/Rector/Src/AddArrayAccessInterfaceReturnTypes.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
use PhpParser\Node;
1111
use PhpParser\Node\Stmt\Class_;
12-
use Rector\Core\Rector\AbstractRector;
12+
use Rector\Rector\AbstractRector;
1313
use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample;
1414
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
1515

Magento2/Rector/Src/ReplaceMbStrposNullLimit.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
use PhpParser\Node;
1111
use PhpParser\Node\Expr\FuncCall;
1212
use PhpParser\Node\Scalar\LNumber;
13-
use Rector\Core\Rector\AbstractRector;
13+
use Rector\Rector\AbstractRector;
1414
use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample;
1515
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
1616

Magento2/Rector/Src/ReplaceNewDateTimeNull.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
use PhpParser\Node;
1111
use PhpParser\Node\Expr\New_;
1212
use PhpParser\Node\Scalar\String_;
13-
use Rector\Core\Rector\AbstractRector;
13+
use Rector\Rector\AbstractRector;
1414
use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample;
1515
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
1616

Magento2/Rector/Src/ReplacePregSplitNullLimit.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
use PhpParser\Node;
1111
use PhpParser\Node\Expr\ConstFetch;
1212
use PhpParser\Node\Expr\FuncCall;
13-
use Rector\Core\Rector\AbstractRector;
13+
use Rector\Rector\AbstractRector;
1414
use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample;
1515
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
1616

Magento2/Sniffs/Annotation/AnnotationFormatValidator.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/**
3-
* Copyright © Magento, Inc. All rights reserved.
4-
* See COPYING.txt for license details.
3+
* Copyright 2021 Adobe
4+
* All Rights Reserved.
55
*/
66
declare(strict_types=1);
77

Magento2/Sniffs/Annotation/MethodAnnotationStructureSniff.php

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/**
3-
* Copyright © Magento, Inc. All rights reserved.
4-
* See COPYING.txt for license details.
3+
* Copyright 2021 Adobe
4+
* All Rights Reserved.
55
*/
66
declare(strict_types=1);
77

@@ -51,13 +51,33 @@ public function register()
5151
public function process(File $phpcsFile, $stackPtr)
5252
{
5353
$tokens = $phpcsFile->getTokens();
54-
$commentStartPtr = $phpcsFile->findPrevious(T_DOC_COMMENT_OPEN_TAG, ($stackPtr), 0);
55-
$commentEndPtr = $phpcsFile->findPrevious(T_DOC_COMMENT_CLOSE_TAG, ($stackPtr), 0);
56-
if (!$commentStartPtr) {
57-
$phpcsFile->addError('Comment block is missing', $stackPtr, 'MethodArguments');
54+
$commentEndPtr = $stackPtr;
55+
$tokensToFind = [
56+
\T_SEMICOLON,
57+
\T_OPEN_CURLY_BRACKET,
58+
\T_CLOSE_CURLY_BRACKET,
59+
\T_ATTRIBUTE_END,
60+
\T_DOC_COMMENT_CLOSE_TAG
61+
];
62+
63+
do {
64+
$commentEndPtr = $phpcsFile->findPrevious($tokensToFind, $commentEndPtr - 1);
65+
if ($commentEndPtr !== false
66+
&& $tokens[$commentEndPtr]['code'] === \T_ATTRIBUTE_END
67+
&& isset($tokens[$commentEndPtr]['attribute_opener'])
68+
) {
69+
$commentEndPtr = $tokens[$commentEndPtr]['attribute_opener'];
70+
}
71+
} while ($commentEndPtr !== false && !in_array($tokens[$commentEndPtr]['code'], $tokensToFind, true));
72+
73+
if ($commentEndPtr === false || $tokens[$commentEndPtr]['code'] !== \T_DOC_COMMENT_CLOSE_TAG) {
74+
$phpcsFile->addError('Comment block is missing', $stackPtr, 'NoCommentBlock');
5875
return;
5976
}
6077

78+
$commentStartPtr = $tokens[$commentEndPtr]['comment_opener']
79+
?? $phpcsFile->findPrevious(T_DOC_COMMENT_OPEN_TAG, $commentEndPtr - 1);
80+
6181
if ($this->PHPDocFormattingValidator->hasDeprecatedWellFormatted($commentStartPtr, $tokens) !== true) {
6282
$phpcsFile->addWarning(
6383
'Motivation behind the added @deprecated tag MUST be explained. '

Magento2/Sniffs/Annotation/MethodArgumentsSniff.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/**
3-
* Copyright © Magento, Inc. All rights reserved.
4-
* See COPYING.txt for license details.
3+
* Copyright 2021 Adobe
4+
* All Rights Reserved.
55
*/
66
declare(strict_types=1);
77

Magento2/Sniffs/Classes/AbstractApiSniff.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/**
3-
* Copyright © Magento, Inc. All rights reserved.
4-
* See COPYING.txt for license details.
3+
* Copyright 2019 Adobe
4+
* All Rights Reserved.
55
*/
66
namespace Magento2\Sniffs\Classes;
77

Magento2/Sniffs/Classes/DiscouragedDependenciesSniff.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/**
3-
* Copyright © Magento, Inc. All rights reserved.
4-
* See COPYING.txt for license details.
3+
* Copyright 2019 Adobe
4+
* All Rights Reserved.
55
*/
66
namespace Magento2\Sniffs\Classes;
77

Magento2/Sniffs/CodeAnalysis/EmptyBlockSniff.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/**
3-
* Copyright © Magento, Inc. All rights reserved.
4-
* See COPYING.txt for license details.
3+
* Copyright 2018 Adobe
4+
* All Rights Reserved.
55
*/
66
namespace Magento2\Sniffs\CodeAnalysis;
77

Magento2/Sniffs/Commenting/ClassAndInterfacePHPDocFormattingSniff.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?php
22

33
/**
4-
* Copyright © Magento, Inc. All rights reserved.
5-
* See COPYING.txt for license details.
4+
* Copyright 2019 Adobe
5+
* All Rights Reserved.
66
*/
77
namespace Magento2\Sniffs\Commenting;
88

Magento2/Sniffs/Commenting/ClassPropertyPHPDocFormattingSniff.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/**
3-
* Copyright © Magento, Inc. All rights reserved.
4-
* See COPYING.txt for license details.
3+
* Copyright 2019 Adobe
4+
* All Rights Reserved.
55
*/
66
declare(strict_types=1);
77

Magento2/Sniffs/Commenting/ConstantsPHPDocFormattingSniff.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/**
3-
* Copyright © Magento, Inc. All rights reserved.
4-
* See COPYING.txt for license details.
3+
* Copyright 2019 Adobe
4+
* All Rights Reserved.
55
*/
66
namespace Magento2\Sniffs\Commenting;
77

Magento2/Sniffs/Exceptions/DirectThrowSniff.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/**
3-
* Copyright © Magento, Inc. All rights reserved.
4-
* See COPYING.txt for license details.
3+
* Copyright 2018 Adobe
4+
* All Rights Reserved.
55
*/
66
namespace Magento2\Sniffs\Exceptions;
77

Magento2/Sniffs/Exceptions/ThrowCatchSniff.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
<?php
22
/**
3-
* Copyright © Magento, Inc. All rights reserved.
4-
* See COPYING.txt for license details.
3+
* Copyright 2019 Adobe
4+
* All Rights Reserved.
55
*/
6-
76
namespace Magento2\Sniffs\Exceptions;
87

98
use function array_slice;

Magento2/Sniffs/Exceptions/TryProcessSystemResourcesSniff.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/**
3-
* Copyright © Magento, Inc. All rights reserved.
4-
* See COPYING.txt for license details.
3+
* Copyright 2019 Adobe
4+
* All Rights Reserved.
55
*/
66
namespace Magento2\Sniffs\Exceptions;
77

Magento2/Sniffs/Functions/DiscouragedFunctionSniff.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/**
3-
* Copyright © Magento, Inc. All rights reserved.
4-
* See COPYING.txt for license details.
3+
* Copyright 2018 Adobe
4+
* All Rights Reserved.
55
*/
66
namespace Magento2\Sniffs\Functions;
77

Magento2/Sniffs/Functions/FunctionsDeprecatedWithoutArgumentSniff.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/**
3-
* Copyright © Magento, Inc. All rights reserved.
4-
* See COPYING.txt for license details.
3+
* Copyright 2021 Adobe
4+
* All Rights Reserved.
55
*/
66
declare(strict_types=1);
77

Magento2/Sniffs/Functions/StaticFunctionSniff.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/**
3-
* Copyright © Magento, Inc. All rights reserved.
4-
* See COPYING.txt for license details.
3+
* Copyright 2019 Adobe
4+
* All Rights Reserved.
55
*/
66
namespace Magento2\Sniffs\Functions;
77

Magento2/Sniffs/GraphQL/AbstractGraphQLSniff.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/**
3-
* Copyright © Magento, Inc. All rights reserved.
4-
* See COPYING.txt for license details.
3+
* Copyright 2019 Adobe
4+
* All Rights Reserved.
55
*/
66
namespace Magento2\Sniffs\GraphQL;
77

Magento2/Sniffs/GraphQL/ValidArgumentNameSniff.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
<?php
22
/**
3-
* Copyright © Magento, Inc. All rights reserved.
4-
* See COPYING.txt for license details.
3+
* Copyright 2019 Adobe
4+
* All Rights Reserved.
55
*/
6-
76
namespace Magento2\Sniffs\GraphQL;
87

98
use GraphQL\Error\SyntaxError;

Magento2/Sniffs/GraphQL/ValidEnumValueSniff.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
<?php
22
/**
3-
* Copyright © Magento, Inc. All rights reserved.
4-
* See COPYING.txt for license details.
3+
* Copyright 2019 Adobe
4+
* All Rights Reserved.
55
*/
6-
76
namespace Magento2\Sniffs\GraphQL;
87

98
use PHP_CodeSniffer\Files\File;

Magento2/Sniffs/GraphQL/ValidFieldNameSniff.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/**
3-
* Copyright © Magento, Inc. All rights reserved.
4-
* See COPYING.txt for license details.
3+
* Copyright 2019 Adobe
4+
* All Rights Reserved.
55
*/
66
namespace Magento2\Sniffs\GraphQL;
77

0 commit comments

Comments
 (0)