mirror of
https://github.com/rectorphp/rector.git
synced 2024-06-01 00:40:52 +00:00
Updated Rector to commit 0348124a5535b99712da4debc136d2e73647b97a
0348124a55
[CodeQuality] Skip Switch_ always returned on ExplicitReturnNullRector (#5800)
This commit is contained in:
parent
b352c8473a
commit
d36c8ad1a5
8
vendor/composer/installed.json
vendored
8
vendor/composer/installed.json
vendored
|
@ -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": {
|
||||
|
@ -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": {
|
||||
|
|
2
vendor/composer/installed.php
vendored
2
vendor/composer/installed.php
vendored
File diff suppressed because one or more lines are too long
|
@ -9,7 +9,7 @@ namespace Rector\RectorInstaller;
|
|||
*/
|
||||
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()
|
||||
{
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
@ -111,19 +115,22 @@ CODE_SAMPLE
|
|||
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;
|
||||
|
@ -144,9 +151,11 @@ CODE_SAMPLE
|
|||
$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);
|
||||
|
|
Loading…
Reference in New Issue
Block a user