Skip to content

Commit 82723b9

Browse files
committed
Update hasDeprecatedWellFormatted + upgrade rector
1 parent 50e7c2a commit 82723b9

7 files changed

+35
-36
lines changed

Magento2/Helpers/Commenting/PHPDocFormattingValidator.php

+2-6
Original file line numberDiff line numberDiff line change
@@ -121,15 +121,11 @@ public function hasDeprecatedWellFormatted($commentStartPtr, $tokens)
121121
if ($deprecatedPtr === -1) {
122122
return true;
123123
}
124-
125-
$seeTagRequired = false;
126-
if ($tokens[$deprecatedPtr + 2]['code'] !== T_DOC_COMMENT_STRING) {
127-
$seeTagRequired = true;
128-
}
129124
$seePtr = $this->getTagPosition('@see', $commentStartPtr, $tokens);
130125
if ($seePtr === -1) {
131-
return !$seeTagRequired;
126+
return false;
132127
}
128+
133129
return $tokens[$seePtr + 2]['code'] === T_DOC_COMMENT_STRING;
134130
}
135131

Magento2/Tests/Commenting/ClassAndInterfacePHPDocFormattingUnitTest.php

+1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ public function getWarningList($testFile = '')
3333
65 => 1,
3434
66 => 1,
3535
101 => 1,
36+
109 => 1,
3637
118 => 1,
3738
127 => 1,
3839
];

Magento2/Tests/Commenting/ConstantsPHPDocFormattingUnitTest.1.inc

-10
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,6 @@ define('DS', DIRECTORY_SEPARATOR);
77

88
define('BP', dirname(__FILE__));
99

10-
/**
11-
* @deprecated It is a lie
12-
*/
13-
define('THERE IS', 'cake');
14-
1510
/**
1611
* @deprecated New implementation available
1712
* @see \Ascii\Asterisk
@@ -27,11 +22,6 @@ class Profiler
2722
*/
2823
const NUMBER_TWO = 2;
2924

30-
/**
31-
* @deprecated Why not
32-
*/
33-
const YES = false;
34-
3525
/**
3626
* @deprecated Unable to identify the question, replaced
3727
* @see \ComputationalMatrix\Earth

Magento2/Tests/Commenting/ConstantsPHPDocFormattingUnitTest.2.inc

+10
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ define('NUMBER_ONE', 1);
1313
*/
1414
define('A', 65);
1515

16+
/**
17+
* @deprecated It is a lie
18+
*/
19+
define('THERE IS', 'cake');
20+
1621
/**
1722
* @deprecated
1823
* @see
@@ -42,6 +47,11 @@ class Profiler
4247
*/
4348
const a = 97;
4449

50+
/**
51+
* @deprecated Why not
52+
*/
53+
const YES = false;
54+
4555
/**
4656
* @deprecated
4757
* @see

Magento2/Tests/Commenting/ConstantsPHPDocFormattingUnitTest.php

+7-5
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,15 @@ public function getWarningList($testFile = '')
3030
6 => 1,
3131
9 => 1,
3232
14 => 1,
33-
20 => 1,
34-
26 => 1,
35-
33 => 1,
33+
19 => 1,
34+
25 => 1,
35+
31 => 1,
3636
38 => 1,
3737
43 => 1,
38-
49 => 1,
39-
55 => 1
38+
48 => 1,
39+
53 => 1,
40+
59 => 1,
41+
65 => 1
4042
];
4143
}
4244
}

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"ext-dom": "*",
1515
"phpcompatibility/php-compatibility": "^9.3",
1616
"squizlabs/php_codesniffer": "^3.6.1",
17-
"rector/rector": "^0.12.17"
17+
"rector/rector": "^0.13.0"
1818
},
1919
"require-dev": {
2020
"phpunit/phpunit": "^9.5.8"

composer.lock

+14-14
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)