Skip to content

Commit

Permalink
Updated Rector to commit 0348124a5535b99712da4debc136d2e73647b97a
Browse files Browse the repository at this point in the history
rectorphp/rector-src@0348124 [CodeQuality] Skip Switch_ always returned on ExplicitReturnNullRector (#5800)
  • Loading branch information
TomasVotruba committed Apr 3, 2024
1 parent b352c84 commit d36c8ad
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 15 deletions.
8 changes: 4 additions & 4 deletions vendor/composer/installed.json
Original file line number Diff line number Diff line change
Expand Up @@ -1802,12 +1802,12 @@
"source": {
"type": "git",
"url": "https:\/\/github.com\/rectorphp\/rector-phpunit.git",
"reference": "6845db43ccd69ef990d399ff845a53ad66fa8085"
"reference": "84b87bc5183d97dfb3582a9dd43c3607b0b51856"
},
"dist": {
"type": "zip",
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-phpunit\/zipball\/6845db43ccd69ef990d399ff845a53ad66fa8085",
"reference": "6845db43ccd69ef990d399ff845a53ad66fa8085",
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-phpunit\/zipball\/84b87bc5183d97dfb3582a9dd43c3607b0b51856",
"reference": "84b87bc5183d97dfb3582a9dd43c3607b0b51856",
"shasum": ""
},
"require": {
Expand All @@ -1830,7 +1830,7 @@
"tomasvotruba\/class-leak": "^0.2",
"tracy\/tracy": "^2.10"
},
"time": "2024-03-08T15:37:45+00:00",
"time": "2024-04-03T14:33:28+00:00",
"default-branch": true,
"type": "rector-extension",
"extra": {
Expand Down
2 changes: 1 addition & 1 deletion vendor/composer/installed.php

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion vendor/rector/extension-installer/src/GeneratedConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
*/
final class GeneratedConfig
{
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'));
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'));
private function __construct()
{
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,7 @@ final class DataProviderArrayItemsNewLinedRector extends AbstractRector
private $betterNodeFinder;
public function __construct(TestsNodeAnalyzer $testsNodeAnalyzer, BetterNodeFinder $betterNodeFinder)
{
/**
* @readonly
*/
$this->testsNodeAnalyzer = $testsNodeAnalyzer;
/**
* @readonly
*/
$this->betterNodeFinder = $betterNodeFinder;
}
public function getRuleDefinition() : RuleDefinition
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ final class TestWithToDataProviderRector extends AbstractRector
* @var \Rector\NodeManipulator\ClassInsertManipulator
*/
private $classInsertManipulator;
/**
* @var bool
*/
private $hasChanged = \false;
public function __construct(TestsNodeAnalyzer $testsNodeAnalyzer, PhpDocInfoFactory $phpDocInfoFactory, PhpDocTagRemover $phpDocTagRemover, DocBlockUpdater $docBlockUpdater, ClassInsertManipulator $classInsertManipulator)
{
$this->testsNodeAnalyzer = $testsNodeAnalyzer;
Expand Down Expand Up @@ -111,19 +115,22 @@ public function refactor(Node $node) : ?Node
if (!$this->testsNodeAnalyzer->isInTestClass($node)) {
return null;
}
$this->hasChanged = \false;
foreach ($node->stmts as $classMethod) {
if (!$classMethod instanceof ClassMethod) {
continue;
}
$this->refactorClassMethod($node, $classMethod);
}
if (!$this->hasChanged) {
return null;
}
return $node;
}
private function refactorClassMethod(Class_ $class, ClassMethod $classMethod) : void
{
$arrayItemsSingleLine = [];
$arrayMultiLine = null;
$hasChanged = \false;
$phpDocInfo = $this->phpDocInfoFactory->createFromNode($classMethod);
if (!$phpDocInfo instanceof PhpDocInfo) {
return;
Expand All @@ -144,9 +151,11 @@ private function refactorClassMethod(Class_ $class, ClassMethod $classMethod) :
$arrayItemsSingleLine[] = new ArrayItem($this->createArrayItem($values[0]));
}
//cleanup
$hasChanged = $this->phpDocTagRemover->removeTagValueFromNode($phpDocInfo, $testWithPhpDocTagNode);
if ($this->phpDocTagRemover->removeTagValueFromNode($phpDocInfo, $testWithPhpDocTagNode)) {
$this->hasChanged = \true;
}
}
if (!$hasChanged) {
if (!$this->hasChanged) {
return;
}
$dataProviderName = $this->generateDataProviderName($classMethod);
Expand Down

0 comments on commit d36c8ad

Please sign in to comment.