Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/develop' into fix/lone-inheritDoc
Browse files Browse the repository at this point in the history
  • Loading branch information
fredden committed Mar 30, 2023
2 parents eb696ed + bc6b0f6 commit b851b81
Show file tree
Hide file tree
Showing 28 changed files with 686 additions and 404 deletions.
1 change: 0 additions & 1 deletion .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ jobs:
fail-fast: false
matrix:
php-version:
- "7.3"
- "7.4"
- "8.0"
- "8.1"
Expand Down
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
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ class AddArrayAccessInterfaceReturnTypesTest extends AbstractRectorTestCase
/**
* @dataProvider provideData()
*/
public function test(SmartFileInfo $fileInfo): void
public function test(string $fileInfo): void
{
$this->doTestFileInfo($fileInfo);
$this->doTestFile($fileInfo);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ class ReplaceMbStrposNullLimitTest extends AbstractRectorTestCase
/**
* @dataProvider provideData()
*/
public function test(SmartFileInfo $fileInfo): void
public function test(string $fileInfo): void
{
$this->doTestFileInfo($fileInfo);
$this->doTestFile($fileInfo);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ class ReplaceNewDateTimeNullTest extends AbstractRectorTestCase
/**
* @dataProvider provideData()
*/
public function test(SmartFileInfo $fileInfo): void
public function test(string $fileInfo): void
{
$this->doTestFileInfo($fileInfo);
$this->doTestFile($fileInfo);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ class ReplacePregSplitNullLimitTest extends AbstractRectorTestCase
/**
* @dataProvider provideData()
*/
public function test(SmartFileInfo $fileInfo): void
public function test(string $fileInfo): void
{
$this->doTestFileInfo($fileInfo);
$this->doTestFile($fileInfo);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ class ClassAndInterfacePHPDocFormattingSniff implements Sniff
* @var string[] List of tags that can not be used in comments
*/
public $forbiddenTags = [
'@author',
'@category',
'@package',
'@subpackage'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ class ClassPropertyPHPDocFormattingSniff extends AbstractVariableSniff
T_NS_SEPARATOR,
T_STRING,
T_COMMENT,
T_NULLABLE
T_NULLABLE,
T_BITWISE_AND,
T_TYPE_UNION,
];

/**
Expand Down
6 changes: 4 additions & 2 deletions Magento2/Sniffs/Legacy/TableNameSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,10 @@ private function checkOccurrencesInProperty(File $phpcsFile, int $stackPtr, arra
private function checkOccurrencesInArray(File $phpcsFile, int $stackPtr, array $tokens): void
{
$aliasPos = $phpcsFile->findPrevious(
T_CONSTANT_ENCAPSED_STRING,
$stackPtr -1
T_WHITESPACE,
$stackPtr - 1,
null,
true,
);

$alias = trim($tokens[$aliasPos]['content'], '\'"');
Expand Down
Loading

0 comments on commit b851b81

Please sign in to comment.