Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into feature/typed_clas…
Browse files Browse the repository at this point in the history
…s_properties

# Conflicts:
#	Magento2/Tests/Commenting/ClassPropertyPHPDocFormattingUnitTest.inc
  • Loading branch information
aligent-lturner committed Apr 11, 2023
2 parents 1e60800 + bc6b0f6 commit ec3b1e4
Show file tree
Hide file tree
Showing 31 changed files with 685 additions and 426 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
@@ -1,14 +1,13 @@
<?php
/**
* Copyright 2021 Adobe
* Copyright 2022 Adobe
* See COPYING.txt for license details.
*/
declare(strict_types=1);

use Magento2\Rector\Src\AddArrayAccessInterfaceReturnTypes;
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
use Rector\Config\RectorConfig;

return static function (ContainerConfigurator $containerConfigurator): void {
$services = $containerConfigurator->services();
$services->set(AddArrayAccessInterfaceReturnTypes::class);
return static function (RectorConfig $rectorConfig): void {
$rectorConfig->rule(AddArrayAccessInterfaceReturnTypes::class);
};
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
@@ -1,14 +1,13 @@
<?php
/**
* Copyright 2021 Adobe
* Copyright 2022 Adobe
* See COPYING.txt for license details.
*/
declare(strict_types=1);

use Magento2\Rector\Src\ReplaceMbStrposNullLimit;
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
use Rector\Config\RectorConfig;

return static function (ContainerConfigurator $containerConfigurator): void {
$services = $containerConfigurator->services();
$services->set(ReplaceMbStrposNullLimit::class);
return static function (RectorConfig $rectorConfig): void {
$rectorConfig->rule(ReplaceMbStrposNullLimit::class);
};
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
@@ -1,14 +1,13 @@
<?php
/**
* Copyright 2021 Adobe
* Copyright 2022 Adobe
* See COPYING.txt for license details.
*/
declare(strict_types=1);

use Magento2\Rector\Src\ReplaceNewDateTimeNull;
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
use Rector\Config\RectorConfig;

return static function (ContainerConfigurator $containerConfigurator): void {
$services = $containerConfigurator->services();
$services->set(ReplaceNewDateTimeNull::class);
return static function (RectorConfig $rectorConfig): void {
$rectorConfig->rule(ReplaceNewDateTimeNull::class);
};
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
@@ -1,14 +1,13 @@
<?php
/**
* Copyright 2021 Adobe
* Copyright 2022 Adobe
* See COPYING.txt for license details.
*/
declare(strict_types=1);

use Magento2\Rector\Src\ReplacePregSplitNullLimit;
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
use Rector\Config\RectorConfig;

return static function (ContainerConfigurator $containerConfigurator): void {
$services = $containerConfigurator->services();
$services->set(ReplacePregSplitNullLimit::class);
return static function (RectorConfig $rectorConfig): void {
$rectorConfig->rule(ReplacePregSplitNullLimit::class);
};
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 ec3b1e4

Please sign in to comment.