Skip to content

Commit

Permalink
Merge branch 'magento:develop' into add-eliminated-zend-classes-as-re…
Browse files Browse the repository at this point in the history
…stricted
  • Loading branch information
xmav authored Sep 14, 2022
2 parents 1000160 + 60dee90 commit 33d03c9
Show file tree
Hide file tree
Showing 6 changed files with 75 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Magento2/Helpers/Commenting/PHPDocFormattingValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,12 @@ public function hasDeprecatedWellFormatted($commentStartPtr, $tokens)
}
$seePtr = $this->getTagPosition('@see', $commentStartPtr, $tokens);
if ($seePtr === -1) {
if (preg_match(
"/This [a-zA-Z]* will be removed in version \d.\d.\d without replacement/",
$tokens[$deprecatedPtr + 2]['content']
)) {
return true;
}
return false;
}

Expand Down
20 changes: 20 additions & 0 deletions Magento2/Tests/Annotation/MethodAnnotationStructureUnitTest.inc
Original file line number Diff line number Diff line change
Expand Up @@ -369,4 +369,24 @@ class MethodAnnotationFixture
{
return true;
}

/**
* This deprecated function is correct even though it only contains the @deprecated tag.
*
* @deprecated This method will be removed in version 1.0.0 without replacement
*/
public function correctBecauseOfKeywordPhrase()
{
return false;
}

/**
* This deprecated function is correct even though it only contains the @deprecated tag.
*
* @deprecated WOW! This method will be removed in version 1.0.0 without replacement
*/
public function alsoCorrectBecauseOfKeywordPhrase()
{
return false;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -162,3 +162,20 @@ class OldHandler
{

}

/**
* @deprecated This class will be removed in version 1.0.0 without replacement
*/
class DeprecatedButHandler
{

}

/**
* @deprecated It's also deprecated - This class will be removed in version 1.0.0 without replacement
*/
class AlsoDeprecatedButHandler
{

}

Original file line number Diff line number Diff line change
Expand Up @@ -153,3 +153,19 @@ interface DoNotCareHandler
{

}

/**
* @deprecated This interface will be removed in version 1.0.0 without replacement
*/
interface DeprecatedButHandler
{

}

/**
* @deprecated Yeah! This interface will be removed in version 1.0.0 without replacement
*/
interface AlsoDeprecatedButHandler
{

}
Original file line number Diff line number Diff line change
Expand Up @@ -194,4 +194,10 @@ class correctlyFormattedClassMemberDocBlock
* @see Message with some reference
*/
protected string $itIsCorrect;

/**
* @var string
* @deprecated This property will be removed in version 1.0.0 without replacement
*/
protected string $deprecatedWithKeyword;
}
10 changes: 10 additions & 0 deletions Magento2/Tests/Commenting/ConstantsPHPDocFormattingUnitTest.2.inc
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,14 @@ class Profiler
* @see
*/
const d = 100;

/**
* @deprecated This constant will be removed in version 1.0.0 without replacement
*/
const KEYWORD_PHRASE = false;

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

0 comments on commit 33d03c9

Please sign in to comment.