Skip to content

Commit 922e108

Browse files
committed
Add without replacement
1 parent 2cf24b3 commit 922e108

6 files changed

+14
-12
lines changed

Magento2/Helpers/Commenting/PHPDocFormattingValidator.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
class PHPDocFormattingValidator
1515
{
1616
private const REMOVED_IN_VERSION = 'removed in version';
17+
private const WITHOUT_REPLACEMENT = 'without replacement';
1718

1819
/**
1920
* Finds matching PHPDoc for current pointer
@@ -125,10 +126,11 @@ public function hasDeprecatedWellFormatted($commentStartPtr, $tokens)
125126
}
126127
$seePtr = $this->getTagPosition('@see', $commentStartPtr, $tokens);
127128
if ($seePtr === -1) {
128-
if (!stripos($tokens[$deprecatedPtr + 2]['content'], self::REMOVED_IN_VERSION, 0)) {
129-
return false;
129+
if (stripos($tokens[$deprecatedPtr + 2]['content'], self::REMOVED_IN_VERSION, 0) &&
130+
stripos($tokens[$deprecatedPtr + 2]['content'], self::WITHOUT_REPLACEMENT, 0)) {
131+
return true;
130132
}
131-
return true;
133+
return false;
132134
}
133135

134136
return $tokens[$seePtr + 2]['code'] === T_DOC_COMMENT_STRING;

Magento2/Tests/Annotation/MethodAnnotationStructureUnitTest.inc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ class MethodAnnotationFixture
373373
/**
374374
* This deprecated function is correct even though it only contains the @deprecated tag.
375375
*
376-
* @deprecated It will be removed in version 1.0.0
376+
* @deprecated It will be removed in version 1.0.0 without replacement
377377
*/
378378
public function correctBecauseOfKeywordPhrase()
379379
{
@@ -383,7 +383,7 @@ class MethodAnnotationFixture
383383
/**
384384
* This deprecated function is correct even though it only contains the @deprecated tag.
385385
*
386-
* @deprecated WOW! It will be removed in version 1.0.0
386+
* @deprecated WOW! It will be removed in version 1.0.0 without replacement
387387
*/
388388
public function alsoCorrectBecauseOfKeywordPhrase()
389389
{

Magento2/Tests/Commenting/ClassAndInterfacePHPDocFormattingUnitTest.1.inc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,15 +164,15 @@ class OldHandler
164164
}
165165

166166
/**
167-
* @deprecated It will be removed in version 1.0.0
167+
* @deprecated It will be removed in version 1.0.0 without replacement
168168
*/
169169
class DeprecatedButHandler
170170
{
171171

172172
}
173173

174174
/**
175-
* @deprecated It's also deprecated, but it will be removed in version 1.0.0
175+
* @deprecated It's also deprecated, but it will be removed in version 1.0.0 without replacement
176176
*/
177177
class AlsoDeprecatedButHandler
178178
{

Magento2/Tests/Commenting/ClassAndInterfacePHPDocFormattingUnitTest.2.inc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,15 +155,15 @@ interface DoNotCareHandler
155155
}
156156

157157
/**
158-
* @deprecated This interface will be removed in version 1.0.0
158+
* @deprecated This interface will be removed in version 1.0.0 without replacement
159159
*/
160160
interface DeprecatedButHandler
161161
{
162162

163163
}
164164

165165
/**
166-
* @deprecated Yeah! This interface will be removed in version 1.0.0
166+
* @deprecated Yeah! This interface will be removed in version 1.0.0 without replacement
167167
*/
168168
interface AlsoDeprecatedButHandler
169169
{

Magento2/Tests/Commenting/ClassPropertyPHPDocFormattingUnitTest.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ class correctlyFormattedClassMemberDocBlock
197197

198198
/**
199199
* @var string
200-
* @deprecated This property will be removed in version 1.0.0
200+
* @deprecated This property will be removed in version 1.0.0 without replacement
201201
*/
202202
protected string $deprecatedWithKeyword;
203203
}

Magento2/Tests/Commenting/ConstantsPHPDocFormattingUnitTest.2.inc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,12 @@ class Profiler
6565
const d = 100;
6666

6767
/**
68-
* @deprecated This constant will be removed in version 1.0.0
68+
* @deprecated This constant will be removed in version 1.0.0 without replacement
6969
*/
7070
const KEYWORD_PHRASE = false;
7171

7272
/**
73-
* @deprecated It's awesome - This constant will be removed in version 1.0.0
73+
* @deprecated It's awesome - This constant will be removed in version 1.0.0 without replacement
7474
*/
7575
const WITH_KEYWORD_PHRASE = false;
7676
}

0 commit comments

Comments
 (0)