Skip to content

Commit d36c8ad

Browse files
committed
Updated Rector to commit 0348124a5535b99712da4debc136d2e73647b97a
rectorphp/rector-src@0348124 [CodeQuality] Skip Switch_ always returned on ExplicitReturnNullRector (#5800)
1 parent b352c84 commit d36c8ad

File tree

5 files changed

+18
-15
lines changed

5 files changed

+18
-15
lines changed

vendor/composer/installed.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1802,12 +1802,12 @@
18021802
"source": {
18031803
"type": "git",
18041804
"url": "https:\/\/github.com\/rectorphp\/rector-phpunit.git",
1805-
"reference": "6845db43ccd69ef990d399ff845a53ad66fa8085"
1805+
"reference": "84b87bc5183d97dfb3582a9dd43c3607b0b51856"
18061806
},
18071807
"dist": {
18081808
"type": "zip",
1809-
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-phpunit\/zipball\/6845db43ccd69ef990d399ff845a53ad66fa8085",
1810-
"reference": "6845db43ccd69ef990d399ff845a53ad66fa8085",
1809+
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-phpunit\/zipball\/84b87bc5183d97dfb3582a9dd43c3607b0b51856",
1810+
"reference": "84b87bc5183d97dfb3582a9dd43c3607b0b51856",
18111811
"shasum": ""
18121812
},
18131813
"require": {
@@ -1830,7 +1830,7 @@
18301830
"tomasvotruba\/class-leak": "^0.2",
18311831
"tracy\/tracy": "^2.10"
18321832
},
1833-
"time": "2024-03-08T15:37:45+00:00",
1833+
"time": "2024-04-03T14:33:28+00:00",
18341834
"default-branch": true,
18351835
"type": "rector-extension",
18361836
"extra": {

vendor/composer/installed.php

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

vendor/rector/extension-installer/src/GeneratedConfig.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
*/
1010
final class GeneratedConfig
1111
{
12-
public const EXTENSIONS = array('rector/rector-doctrine' => array('install_path' => '/home/runner/work/rector-src/rector-src/rector-build/vendor/rector/rector-doctrine', 'relative_install_path' => '../../rector-doctrine', 'extra' => NULL, 'version' => 'dev-main b3da143'), 'rector/rector-downgrade-php' => array('install_path' => '/home/runner/work/rector-src/rector-src/rector-build/vendor/rector/rector-downgrade-php', 'relative_install_path' => '../../rector-downgrade-php', 'extra' => NULL, 'version' => 'dev-main 05e44cf'), 'rector/rector-phpunit' => array('install_path' => '/home/runner/work/rector-src/rector-src/rector-build/vendor/rector/rector-phpunit', 'relative_install_path' => '../../rector-phpunit', 'extra' => NULL, 'version' => 'dev-main 6845db4'), 'rector/rector-symfony' => array('install_path' => '/home/runner/work/rector-src/rector-src/rector-build/vendor/rector/rector-symfony', 'relative_install_path' => '../../rector-symfony', 'extra' => NULL, 'version' => 'dev-main c8b6413'));
12+
public const EXTENSIONS = array('rector/rector-doctrine' => array('install_path' => '/home/runner/work/rector-src/rector-src/rector-build/vendor/rector/rector-doctrine', 'relative_install_path' => '../../rector-doctrine', 'extra' => NULL, 'version' => 'dev-main b3da143'), 'rector/rector-downgrade-php' => array('install_path' => '/home/runner/work/rector-src/rector-src/rector-build/vendor/rector/rector-downgrade-php', 'relative_install_path' => '../../rector-downgrade-php', 'extra' => NULL, 'version' => 'dev-main 05e44cf'), 'rector/rector-phpunit' => array('install_path' => '/home/runner/work/rector-src/rector-src/rector-build/vendor/rector/rector-phpunit', 'relative_install_path' => '../../rector-phpunit', 'extra' => NULL, 'version' => 'dev-main 84b87bc'), 'rector/rector-symfony' => array('install_path' => '/home/runner/work/rector-src/rector-src/rector-build/vendor/rector/rector-symfony', 'relative_install_path' => '../../rector-symfony', 'extra' => NULL, 'version' => 'dev-main c8b6413'));
1313
private function __construct()
1414
{
1515
}

vendor/rector/rector-phpunit/rules/CodeQuality/Rector/ClassMethod/DataProviderArrayItemsNewLinedRector.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,7 @@ final class DataProviderArrayItemsNewLinedRector extends AbstractRector
3131
private $betterNodeFinder;
3232
public function __construct(TestsNodeAnalyzer $testsNodeAnalyzer, BetterNodeFinder $betterNodeFinder)
3333
{
34-
/**
35-
* @readonly
36-
*/
3734
$this->testsNodeAnalyzer = $testsNodeAnalyzer;
38-
/**
39-
* @readonly
40-
*/
4135
$this->betterNodeFinder = $betterNodeFinder;
4236
}
4337
public function getRuleDefinition() : RuleDefinition

vendor/rector/rector-phpunit/rules/CodeQuality/Rector/Class_/TestWithToDataProviderRector.php

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,10 @@ final class TestWithToDataProviderRector extends AbstractRector
5656
* @var \Rector\NodeManipulator\ClassInsertManipulator
5757
*/
5858
private $classInsertManipulator;
59+
/**
60+
* @var bool
61+
*/
62+
private $hasChanged = \false;
5963
public function __construct(TestsNodeAnalyzer $testsNodeAnalyzer, PhpDocInfoFactory $phpDocInfoFactory, PhpDocTagRemover $phpDocTagRemover, DocBlockUpdater $docBlockUpdater, ClassInsertManipulator $classInsertManipulator)
6064
{
6165
$this->testsNodeAnalyzer = $testsNodeAnalyzer;
@@ -111,19 +115,22 @@ public function refactor(Node $node) : ?Node
111115
if (!$this->testsNodeAnalyzer->isInTestClass($node)) {
112116
return null;
113117
}
118+
$this->hasChanged = \false;
114119
foreach ($node->stmts as $classMethod) {
115120
if (!$classMethod instanceof ClassMethod) {
116121
continue;
117122
}
118123
$this->refactorClassMethod($node, $classMethod);
119124
}
125+
if (!$this->hasChanged) {
126+
return null;
127+
}
120128
return $node;
121129
}
122130
private function refactorClassMethod(Class_ $class, ClassMethod $classMethod) : void
123131
{
124132
$arrayItemsSingleLine = [];
125133
$arrayMultiLine = null;
126-
$hasChanged = \false;
127134
$phpDocInfo = $this->phpDocInfoFactory->createFromNode($classMethod);
128135
if (!$phpDocInfo instanceof PhpDocInfo) {
129136
return;
@@ -144,9 +151,11 @@ private function refactorClassMethod(Class_ $class, ClassMethod $classMethod) :
144151
$arrayItemsSingleLine[] = new ArrayItem($this->createArrayItem($values[0]));
145152
}
146153
//cleanup
147-
$hasChanged = $this->phpDocTagRemover->removeTagValueFromNode($phpDocInfo, $testWithPhpDocTagNode);
154+
if ($this->phpDocTagRemover->removeTagValueFromNode($phpDocInfo, $testWithPhpDocTagNode)) {
155+
$this->hasChanged = \true;
156+
}
148157
}
149-
if (!$hasChanged) {
158+
if (!$this->hasChanged) {
150159
return;
151160
}
152161
$dataProviderName = $this->generateDataProviderName($classMethod);

0 commit comments

Comments
 (0)