Skip to content

Commit 4c0e6fc

Browse files
committed
Fix remaining phpcs issues on Magento2/Rector
1 parent 9392d02 commit 4c0e6fc

File tree

7 files changed

+20
-23
lines changed

7 files changed

+20
-23
lines changed

.github/workflows/php.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,10 @@ jobs:
5454
run: vendor/bin/phpunit
5555

5656
- name: Run code style suite
57-
run: vendor/bin/phpcs --standard=Magento2 Magento2/Helpers Magento2/Sniffs Magento2Framework/Sniffs
57+
run: vendor/bin/phpcs --standard=Magento2 Magento2/Helpers Magento2/Sniffs Magento2/Rector Magento2Framework/Sniffs
5858

5959
- name: Run framework suite
60-
run: vendor/bin/phpcs --standard=Magento2Framework Magento2/Helpers Magento2/Sniffs Magento2Framework/Sniffs
60+
run: vendor/bin/phpcs --standard=Magento2Framework Magento2/Helpers Magento2/Sniffs Magento2/Rector Magento2Framework/Sniffs
6161
js:
6262
runs-on: ubuntu-latest
6363
name: Javascript tests

Magento2/Rector/Src/ReplaceMbStrposNullLimit.php

+4-6
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,21 @@
1111
use PhpParser\Node\Expr\FuncCall;
1212
use PhpParser\Node\Scalar\LNumber;
1313
use Rector\Core\Rector\AbstractRector;
14-
use Symplify\RuleDocGenerator\Exception\PoorDocumentationException;
1514
use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample;
1615
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
1716

18-
final class ReplaceMbStrposNullLimit extends AbstractRector
17+
class ReplaceMbStrposNullLimit extends AbstractRector
1918
{
2019
/**
21-
* @return array<class-string<Node>>
20+
* @inheritDoc
2221
*/
2322
public function getNodeTypes(): array
2423
{
2524
return [FuncCall::class];
2625
}
2726

2827
/**
29-
* @param FuncCall $node
28+
* @inheritDoc
3029
*/
3130
public function refactor(Node $node): ?Node
3231
{
@@ -43,8 +42,7 @@ public function refactor(Node $node): ?Node
4342
}
4443

4544
/**
46-
* @return RuleDefinition
47-
* @throws PoorDocumentationException
45+
* @inheritDoc
4846
*/
4947
public function getRuleDefinition(): RuleDefinition
5048
{

Magento2/Rector/Src/ReplaceNewDateTimeNull.php

+4-6
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,21 @@
1111
use PhpParser\Node\Expr\New_;
1212
use PhpParser\Node\Scalar\String_;
1313
use Rector\Core\Rector\AbstractRector;
14-
use Symplify\RuleDocGenerator\Exception\PoorDocumentationException;
1514
use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample;
1615
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
1716

18-
final class ReplaceNewDateTimeNull extends AbstractRector
17+
class ReplaceNewDateTimeNull extends AbstractRector
1918
{
2019
/**
21-
* @return array<class-string<Node>>
20+
* @inheritDoc
2221
*/
2322
public function getNodeTypes(): array
2423
{
2524
return [New_::class];
2625
}
2726

2827
/**
29-
* @param New_ $node
28+
* @inheritDoc
3029
*/
3130
public function refactor(Node $node): ?Node
3231
{
@@ -43,8 +42,7 @@ public function refactor(Node $node): ?Node
4342
}
4443

4544
/**
46-
* @return RuleDefinition
47-
* @throws PoorDocumentationException
45+
* @inheritDoc
4846
*/
4947
public function getRuleDefinition(): RuleDefinition
5048
{

Magento2/Rector/Src/ReplacePregSplitNullLimit.php

+4-6
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,21 @@
1111
use PhpParser\Node\Expr\FuncCall;
1212
use PhpParser\Node\Scalar\LNumber;
1313
use Rector\Core\Rector\AbstractRector;
14-
use Symplify\RuleDocGenerator\Exception\PoorDocumentationException;
1514
use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample;
1615
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
1716

18-
final class ReplacePregSplitNullLimit extends AbstractRector
17+
class ReplacePregSplitNullLimit extends AbstractRector
1918
{
2019
/**
21-
* @return array<class-string<Node>>
20+
* @inheritDoc
2221
*/
2322
public function getNodeTypes(): array
2423
{
2524
return [FuncCall::class];
2625
}
2726

2827
/**
29-
* @param FuncCall $node
28+
* @inheritDoc
3029
*/
3130
public function refactor(Node $node): ?Node
3231
{
@@ -43,8 +42,7 @@ public function refactor(Node $node): ?Node
4342
}
4443

4544
/**
46-
* @return RuleDefinition
47-
* @throws PoorDocumentationException
45+
* @inheritDoc
4846
*/
4947
public function getRuleDefinition(): RuleDefinition
5048
{

Magento2/Rector/Tests/ReplaceMbStrposNullLimit/ReplaceMbStrposNullLimitTest.php

+4-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
use Rector\Testing\PHPUnit\AbstractRectorTestCase;
1212
use Symplify\SmartFileSystem\SmartFileInfo;
1313

14-
final class ReplaceMbStrposNullLimitTest extends AbstractRectorTestCase
14+
class ReplaceMbStrposNullLimitTest extends AbstractRectorTestCase
1515
{
1616
/**
1717
* @dataProvider provideData()
@@ -29,6 +29,9 @@ public function provideData(): Iterator
2929
return $this->yieldFilesFromDirectory(__DIR__ . '/Fixture');
3030
}
3131

32+
/**
33+
* @return string
34+
*/
3235
public function provideConfigFilePath(): string
3336
{
3437
return __DIR__ . '/config/configured_rule.php';

Magento2/Rector/Tests/ReplaceNewDateTimeNull/ReplaceNewDateTimeNullTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
use Rector\Testing\PHPUnit\AbstractRectorTestCase;
1212
use Symplify\SmartFileSystem\SmartFileInfo;
1313

14-
final class ReplaceNewDateTimeNullTest extends AbstractRectorTestCase
14+
class ReplaceNewDateTimeNullTest extends AbstractRectorTestCase
1515
{
1616
/**
1717
* @dataProvider provideData()

Magento2/Rector/Tests/ReplacePregSplitNullLimit/ReplacePregSplitNullLimitTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
use Rector\Testing\PHPUnit\AbstractRectorTestCase;
1212
use Symplify\SmartFileSystem\SmartFileInfo;
1313

14-
final class ReplacePregSplitNullLimitTest extends AbstractRectorTestCase
14+
class ReplacePregSplitNullLimitTest extends AbstractRectorTestCase
1515
{
1616
/**
1717
* @dataProvider provideData()

0 commit comments

Comments
 (0)